XTJSDBService.cs 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using QWPlatform.IService;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Data;
  7. using PMS.EntityModels.SysManager;
  8. namespace PMS.DBService.SysManager
  9. {
  10. public class XTJSDBService : DataServiceBase
  11. {
  12. //实例化数据库
  13. public DataServiceBase dataservice = new DataServiceBase();
  14. /// <summary>
  15. /// 删除系统角色
  16. /// </summary>
  17. public void RoleDel(int id)
  18. {
  19. this.DeleteBulider.Delete("系统角色")
  20. .Where("ID", id).Execute();
  21. }
  22. /// <summary>
  23. /// 通过id查询系统角色信息
  24. /// </summary>
  25. /// <param name="id"></param>
  26. /// <returns></returns>
  27. public DataTable GetSystemRoleInfo(int id)
  28. {
  29. var dt = this.SelectBuilder.From("系统角色")
  30. .Columns("*").Where("ID", id)
  31. .Select();
  32. return dt;
  33. }
  34. /// <summary>
  35. /// 修改,新增系统角色
  36. /// </summary>
  37. /// <param name="model"></param>
  38. /// <returns></returns>
  39. public string SaveRoleInfo(XTJSModel model,int type_in)
  40. {
  41. // procedure B_系统角色_Edit
  42. //(
  43. //Id_in in 系统角色.ID % type,
  44. //Bz_in in 系统角色.备注 % type,
  45. //Mc_in in 系统角色.名称 % type,
  46. //Qy_in in 系统角色.启用 % type,
  47. //Xh_in in 系统角色.序号 % type,
  48. //MR_in in 系统角色.默认 % type,
  49. //GK_in in 系统角色.公开 % type,
  50. //类型_in in number, --新增 0 修改 1
  51. //Result_out out varchar2
  52. //);
  53. var result = this.ProcedureBuilder.Procedure("B_基础管理_系统角色.B_系统角色_Edit")
  54. .Paramter("Id_in", model.ID)
  55. .Paramter("Bz_in", model.BZ)
  56. .Paramter("Mc_in", model.MC)
  57. .Paramter("Qy_in", model.QY)
  58. .Paramter("Xh_in", model.XH)
  59. .Paramter("MR_in",model.MR)
  60. .Paramter("GK_in",model.GK)
  61. .Paramter("XMSQ_in", model.XMSQ)
  62. .Paramter("JGSQ_in", model.JGSQ)
  63. .Paramter("类型_in", type_in)
  64. .ParamterOut("Result_out", DbType.String, 400);
  65. result.Execute();
  66. return result.ParameterValue<string>("Result_out");
  67. }
  68. /// <summary>
  69. /// 获取最大序列号值
  70. /// </summary>
  71. /// <returns></returns>
  72. public string RoleXh()
  73. {
  74. string sql = "select 序号 from(select 序号 from 系统角色 order by 序号 desc) where rownum = 1 ";
  75. return this.SqlBuilder.SqlText(sql).Select<string>();
  76. }
  77. /// <summary>
  78. /// 判断输入的系统角色是否重复并提示
  79. /// </summary>
  80. /// <param name="name"></param>
  81. /// <returns></returns>
  82. public string RoleNameCheck(string name)
  83. {
  84. var result = this.ProcedureBuilder.Procedure("B_基础管理_系统角色.B_系统角色_RoleNameCheck")
  85. .Paramter("Name_in", name)
  86. .ParamterOut("Result_out", DbType.String, 400);
  87. result.Execute();
  88. return result.ParameterValue<string>("Result_out");
  89. }
  90. }
  91. }