No Description

T_Sys_RoleFunction.cs 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. using System;
  2. using System.Data;
  3. using System.Collections.Generic;
  4. using CallCenterApi.Model;
  5. namespace CallCenterApi.BLL
  6. {
  7. /// <summary>
  8. /// T_Sys_RoleFunction
  9. /// </summary>
  10. public partial class T_Sys_RoleFunction
  11. {
  12. private readonly CallCenterApi.DAL.T_Sys_RoleFunction dal = new CallCenterApi.DAL.T_Sys_RoleFunction();
  13. public T_Sys_RoleFunction()
  14. { }
  15. #region Method
  16. /// <summary>
  17. /// 得到最大ID
  18. /// </summary>
  19. public int GetMaxId()
  20. {
  21. return dal.GetMaxId();
  22. }
  23. /// <summary>
  24. /// 是否存在该记录
  25. /// </summary>
  26. public bool Exists(int F_RoleId, int F_FunctionId)
  27. {
  28. return dal.Exists(F_RoleId, F_FunctionId);
  29. }
  30. /// <summary>
  31. /// 增加一条数据
  32. /// </summary>
  33. public bool Add(CallCenterApi.Model.T_Sys_RoleFunction model)
  34. {
  35. return dal.Add(model);
  36. }
  37. /// <summary>
  38. /// 更新一条数据
  39. /// </summary>
  40. public bool Update(CallCenterApi.Model.T_Sys_RoleFunction model)
  41. {
  42. return dal.Update(model);
  43. }
  44. /// <summary>
  45. /// 删除一条数据
  46. /// </summary>
  47. public bool Delete(int F_RoleId, int F_FunctionId)
  48. {
  49. return dal.Delete(F_RoleId, F_FunctionId);
  50. }
  51. /// <summary>
  52. /// 得到一个对象实体
  53. /// </summary>
  54. public CallCenterApi.Model.T_Sys_RoleFunction GetModel(int F_RoleId, int F_FunctionId)
  55. {
  56. return dal.GetModel(F_RoleId, F_FunctionId);
  57. }
  58. /// <summary>
  59. /// 获得数据列表
  60. /// </summary>
  61. public DataSet GetList(string strWhere)
  62. {
  63. return dal.GetList(strWhere);
  64. }
  65. /// <summary>
  66. /// 获得前几行数据
  67. /// </summary>
  68. public DataSet GetList(int Top, string strWhere, string filedOrder)
  69. {
  70. return dal.GetList(Top, strWhere, filedOrder);
  71. }
  72. /// <summary>
  73. /// 获得数据列表
  74. /// </summary>
  75. public List<CallCenterApi.Model.T_Sys_RoleFunction> GetModelList(string strWhere)
  76. {
  77. DataSet ds = dal.GetList(strWhere);
  78. return DataTableToList(ds.Tables[0]);
  79. }
  80. /// <summary>
  81. /// 获得数据列表
  82. /// </summary>
  83. public List<CallCenterApi.Model.T_Sys_RoleFunction> DataTableToList(DataTable dt)
  84. {
  85. List<CallCenterApi.Model.T_Sys_RoleFunction> modelList = new List<CallCenterApi.Model.T_Sys_RoleFunction>();
  86. int rowsCount = dt.Rows.Count;
  87. if (rowsCount > 0)
  88. {
  89. CallCenterApi.Model.T_Sys_RoleFunction model;
  90. for (int n = 0; n < rowsCount; n++)
  91. {
  92. model = new CallCenterApi.Model.T_Sys_RoleFunction();
  93. if (dt.Rows[n]["F_RoleId"] != null && dt.Rows[n]["F_RoleId"].ToString() != "")
  94. {
  95. model.F_RoleId = int.Parse(dt.Rows[n]["F_RoleId"].ToString());
  96. }
  97. if (dt.Rows[n]["F_FunctionId"] != null && dt.Rows[n]["F_FunctionId"].ToString() != "")
  98. {
  99. model.F_FunctionId = int.Parse(dt.Rows[n]["F_FunctionId"].ToString());
  100. }
  101. if (dt.Rows[n]["F_IsKey"] != null && dt.Rows[n]["F_IsKey"].ToString() != "")
  102. {
  103. model.F_IsKey = int.Parse(dt.Rows[n]["F_IsKey"].ToString());
  104. }
  105. if (dt.Rows[n]["F_Short"] != null && dt.Rows[n]["F_Short"].ToString() != "")
  106. {
  107. model.F_Short = int.Parse(dt.Rows[n]["F_Short"].ToString());
  108. }
  109. modelList.Add(model);
  110. }
  111. }
  112. return modelList;
  113. }
  114. /// <summary>
  115. /// 获得数据列表
  116. /// </summary>
  117. public DataSet GetAllList()
  118. {
  119. return GetList("");
  120. }
  121. /// <summary>
  122. /// 分页获取数据列表
  123. /// </summary>
  124. public int GetRecordCount(string strWhere)
  125. {
  126. return dal.GetRecordCount(strWhere);
  127. }
  128. /// <summary>
  129. /// 分页获取数据列表
  130. /// </summary>
  131. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  132. {
  133. return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
  134. }
  135. /// <summary>
  136. /// 分页获取数据列表
  137. /// </summary>
  138. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  139. //{
  140. //return dal.GetList(PageSize,PageIndex,strWhere);
  141. //}
  142. #endregion Method
  143. }
  144. }