Brak opisu

T_Repository_List_Audit.cs 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace CallCenterApi.BLL
  8. {
  9. /// <summary>
  10. /// T_Repository_List_Audit
  11. /// </summary>
  12. public partial class T_Repository_List_Audit
  13. {
  14. private readonly CallCenterApi.DAL.T_Repository_List_Audit dal = new CallCenterApi.DAL.T_Repository_List_Audit();
  15. public T_Repository_List_Audit()
  16. { }
  17. #region Method
  18. /// <summary>
  19. /// 是否存在该记录
  20. /// </summary>
  21. public bool Exists(int F_AuditId)
  22. {
  23. return dal.Exists(F_AuditId);
  24. }
  25. /// <summary>
  26. /// 增加一条数据
  27. /// </summary>
  28. public int Add(CallCenterApi.Model.T_Repository_List_Audit model)
  29. {
  30. return dal.Add(model);
  31. }
  32. /// <summary>
  33. /// 更新一条数据
  34. /// </summary>
  35. public bool Update(CallCenterApi.Model.T_Repository_List_Audit model)
  36. {
  37. return dal.Update(model);
  38. }
  39. /// <summary>
  40. /// 删除一条数据
  41. /// </summary>
  42. public bool Delete(int F_AuditId)
  43. {
  44. return dal.Delete(F_AuditId);
  45. }
  46. /// <summary>
  47. /// 删除一条数据
  48. /// </summary>
  49. public bool DeleteList(string F_AuditIdlist)
  50. {
  51. return dal.DeleteList(F_AuditIdlist);
  52. }
  53. /// <summary>
  54. /// 得到一个对象实体
  55. /// </summary>
  56. public CallCenterApi.Model.T_Repository_List_Audit GetModel(int F_AuditId)
  57. {
  58. return dal.GetModel(F_AuditId);
  59. }
  60. /// <summary>
  61. /// 获得数据列表
  62. /// </summary>
  63. public DataSet GetList(string strWhere)
  64. {
  65. return dal.GetList(strWhere);
  66. }
  67. /// <summary>
  68. /// 获得前几行数据
  69. /// </summary>
  70. public DataSet GetList(int Top, string strWhere, string filedOrder)
  71. {
  72. return dal.GetList(Top, strWhere, filedOrder);
  73. }
  74. /// <summary>
  75. /// 获得数据列表
  76. /// </summary>
  77. public List<CallCenterApi.Model.T_Repository_List_Audit> GetModelList(string strWhere)
  78. {
  79. DataSet ds = dal.GetList(strWhere);
  80. return DataTableToList(ds.Tables[0]);
  81. }
  82. /// <summary>
  83. /// 获得数据列表
  84. /// </summary>
  85. public List<CallCenterApi.Model.T_Repository_List_Audit> DataTableToList(DataTable dt)
  86. {
  87. List<CallCenterApi.Model.T_Repository_List_Audit> modelList = new List<CallCenterApi.Model.T_Repository_List_Audit>();
  88. int rowsCount = dt.Rows.Count;
  89. if (rowsCount > 0)
  90. {
  91. CallCenterApi.Model.T_Repository_List_Audit model;
  92. for (int n = 0; n < rowsCount; n++)
  93. {
  94. model = new CallCenterApi.Model.T_Repository_List_Audit();
  95. if (dt.Rows[n]["F_AuditId"] != null && dt.Rows[n]["F_AuditId"].ToString() != "")
  96. {
  97. model.F_AuditId = int.Parse(dt.Rows[n]["F_AuditId"].ToString());
  98. }
  99. if (dt.Rows[n]["F_RepositoryId"] != null && dt.Rows[n]["F_RepositoryId"].ToString() != "")
  100. {
  101. model.F_RepositoryId = int.Parse(dt.Rows[n]["F_RepositoryId"].ToString());
  102. }
  103. if (dt.Rows[n]["F_Action"] != null && dt.Rows[n]["F_Action"].ToString() != "")
  104. {
  105. model.F_Action = int.Parse(dt.Rows[n]["F_Action"].ToString());
  106. }
  107. if (dt.Rows[n]["F_CreateOn"] != null && dt.Rows[n]["F_CreateOn"].ToString() != "")
  108. {
  109. model.F_CreateOn = DateTime.Parse(dt.Rows[n]["F_CreateOn"].ToString());
  110. }
  111. if (dt.Rows[n]["F_CreateBy"] != null)
  112. {
  113. model.F_CreateBy = dt.Rows[n]["F_CreateBy"].ToString();
  114. }
  115. if (dt.Rows[n]["F_PreLogID"] != null && dt.Rows[n]["F_PreLogID"].ToString() != "")
  116. {
  117. model.F_PreLogID = int.Parse(dt.Rows[n]["F_PreLogID"].ToString());
  118. }
  119. if (dt.Rows[n]["F_AfterLogID"] != null && dt.Rows[n]["F_AfterLogID"].ToString() != "")
  120. {
  121. model.F_AfterLogID = int.Parse(dt.Rows[n]["F_AfterLogID"].ToString());
  122. }
  123. if (dt.Rows[n]["F_AuditOn"] != null && dt.Rows[n]["F_AuditOn"].ToString() != "")
  124. {
  125. model.F_AuditOn = DateTime.Parse(dt.Rows[n]["F_AuditOn"].ToString());
  126. }
  127. if (dt.Rows[n]["F_AuditBy"] != null)
  128. {
  129. model.F_AuditBy = dt.Rows[n]["F_AuditBy"].ToString();
  130. }
  131. if (dt.Rows[n]["F_ISPass"] != null && dt.Rows[n]["F_ISPass"].ToString() != "")
  132. {
  133. model.F_ISPass = int.Parse(dt.Rows[n]["F_ISPass"].ToString());
  134. }
  135. if (dt.Rows[n]["F_AuditRemark"] != null && dt.Rows[n]["F_AuditRemark"].ToString() != "")
  136. {
  137. model.F_AuditRemark = dt.Rows[n]["F_AuditRemark"].ToString();
  138. }
  139. if (dt.Rows[n]["F_Expand1"] != null && dt.Rows[n]["F_Expand1"].ToString() != "")
  140. {
  141. model.F_Expand1 = dt.Rows[n]["F_Expand1"].ToString();
  142. }
  143. if (dt.Rows[n]["F_Expand2"] != null && dt.Rows[n]["F_Expand2"].ToString() != "")
  144. {
  145. model.F_Expand2 = dt.Rows[n]["F_Expand2"].ToString();
  146. }
  147. if (dt.Rows[n]["F_IntExpand1"] != null && dt.Rows[n]["F_IntExpand1"].ToString() != "")
  148. {
  149. model.F_IntExpand1 = int.Parse(dt.Rows[n]["F_IntExpand1"].ToString());
  150. }
  151. modelList.Add(model);
  152. }
  153. }
  154. return modelList;
  155. }
  156. /// <summary>
  157. /// 获得数据列表
  158. /// </summary>
  159. public DataSet GetAllList()
  160. {
  161. return GetList("");
  162. }
  163. /// <summary>
  164. /// 分页获取数据列表
  165. /// </summary>
  166. public int GetRecordCount(string strWhere)
  167. {
  168. return dal.GetRecordCount(strWhere);
  169. }
  170. /// <summary>
  171. /// 分页获取数据列表
  172. /// </summary>
  173. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  174. {
  175. return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
  176. }
  177. #endregion Method
  178. }
  179. }