Bez popisu

T_Sys_UserAccount.cs 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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_Sys_UserAccount
  11. /// </summary>
  12. public partial class T_Sys_UserAccount
  13. {
  14. private readonly DAL.T_Sys_UserAccount dal = new DAL.T_Sys_UserAccount();
  15. public T_Sys_UserAccount()
  16. { }
  17. #region BasicMethod
  18. /// <summary>
  19. /// 得到最大ID
  20. /// </summary>
  21. public int GetMaxId()
  22. {
  23. return dal.GetMaxId();
  24. }
  25. /// <summary>
  26. /// 是否存在该记录
  27. /// </summary>
  28. public bool Exists(int F_UserId)
  29. {
  30. return dal.Exists(F_UserId);
  31. }
  32. /// <summary>
  33. /// 增加一条数据
  34. /// </summary>
  35. public int Add(Model.T_Sys_UserAccount model)
  36. {
  37. return dal.Add(model);
  38. }
  39. /// <summary>
  40. /// 更新一条数据
  41. /// </summary>
  42. public bool Update(Model.T_Sys_UserAccount model)
  43. {
  44. return dal.Update(model);
  45. }
  46. /// <summary>
  47. /// 删除一条数据
  48. /// </summary>
  49. public bool Delete(int F_UserId)
  50. {
  51. return dal.Delete(F_UserId);
  52. }
  53. /// <summary>
  54. /// 删除一条数据
  55. /// </summary>
  56. public bool DeleteList(string F_UserIdlist)
  57. {
  58. return dal.DeleteList(F_UserIdlist);
  59. }
  60. /// <summary>
  61. /// 更新数据状态 批量
  62. /// </summary>
  63. public bool DeleteList(string F_UserIdlist, int state)
  64. {
  65. return dal.DeleteList(F_UserIdlist, state);
  66. }
  67. /// <summary>
  68. /// 得到一个对象实体
  69. /// </summary>
  70. public Model.T_Sys_UserAccount GetModel(int F_UserId)
  71. {
  72. return dal.GetModel(F_UserId);
  73. }
  74. /// <summary>
  75. /// 得到一个对象实体
  76. /// </summary>
  77. public Model.T_Sys_UserAccount GetModel(string F_UserCode)
  78. {
  79. return dal.GetModel(F_UserCode);
  80. }
  81. /// <summary>
  82. /// 得到一个对象实体
  83. /// </summary>
  84. public Model.T_Sys_UserAccount GetModelUserName(string UserName)
  85. {
  86. return dal.GetModelUserName(UserName);
  87. }
  88. /// <summary>
  89. /// 登录得到一个对象实体
  90. /// </summary>
  91. public Model.T_Sys_UserAccount LoginGetModel(string F_UserCode, string F_Password)
  92. {
  93. return dal.LoginGetModel(F_UserCode, F_Password);
  94. }
  95. ///// <summary>
  96. ///// 得到一个对象实体,从缓存中
  97. ///// </summary>
  98. //public Model.T_Sys_UserAccount GetModelByCache(int F_UserId)
  99. //{
  100. // string CacheKey = "T_Sys_UserAccountModel-" + F_UserId;
  101. // object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey);
  102. // if (objModel == null)
  103. // {
  104. // try
  105. // {
  106. // objModel = dal.GetModel(F_UserId);
  107. // if (objModel != null)
  108. // {
  109. // int ModelCache = Maticsoft.Common.ConfigHelper.GetConfigInt("ModelCache");
  110. // Maticsoft.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
  111. // }
  112. // }
  113. // catch{}
  114. // }
  115. // return (Model.T_Sys_UserAccount)objModel;
  116. //}
  117. /// <summary>
  118. /// 获得数据列表
  119. /// </summary>
  120. public DataSet GetList(string strWhere)
  121. {
  122. return dal.GetList(strWhere);
  123. }
  124. public DataSet GetListView(string strWhere)
  125. {
  126. return dal.GetListView(strWhere);
  127. }
  128. /// <summary>
  129. /// 获得前几行数据
  130. /// </summary>
  131. public DataSet GetList(int Top, string strWhere, string filedOrder)
  132. {
  133. return dal.GetList(Top, strWhere, filedOrder);
  134. }
  135. /// <summary>
  136. /// 获得数据列表
  137. /// </summary>
  138. public List<Model.T_Sys_UserAccount> GetModelList(string strWhere)
  139. {
  140. DataSet ds = dal.GetList(strWhere);
  141. return DataTableToList(ds.Tables[0]);
  142. }
  143. /// <summary>
  144. /// 获得数据列表
  145. /// </summary>
  146. public List<Model.T_Sys_UserAccount> DataTableToList(DataTable dt)
  147. {
  148. List<Model.T_Sys_UserAccount> modelList = new List<Model.T_Sys_UserAccount>();
  149. int rowsCount = dt.Rows.Count;
  150. if (rowsCount > 0)
  151. {
  152. Model.T_Sys_UserAccount model;
  153. for (int n = 0; n < rowsCount; n++)
  154. {
  155. model = dal.DataRowToModel(dt.Rows[n]);
  156. if (model != null)
  157. {
  158. modelList.Add(model);
  159. }
  160. }
  161. }
  162. return modelList;
  163. }
  164. public List<Model.T_Sys_UserAccount> DataTableToList1(DataTable dt)
  165. {
  166. List<Model.T_Sys_UserAccount> modelList = new List<Model.T_Sys_UserAccount>();
  167. int rowsCount = dt.Rows.Count;
  168. if (rowsCount > 0)
  169. {
  170. Model.T_Sys_UserAccount model;
  171. for (int n = 0; n < rowsCount; n++)
  172. {
  173. model = dal.DataRowToModel1(dt.Rows[n]);
  174. if (model != null)
  175. {
  176. modelList.Add(model);
  177. }
  178. }
  179. }
  180. return modelList;
  181. }
  182. /// <summary>
  183. /// 获得数据列表
  184. /// </summary>
  185. public DataSet GetAllList()
  186. {
  187. return GetList("");
  188. }
  189. /// <summary>
  190. /// 分页获取数据列表
  191. /// </summary>
  192. public int GetRecordCount(string strWhere)
  193. {
  194. return dal.GetRecordCount(strWhere);
  195. }
  196. /// <summary>
  197. /// 分页获取数据列表
  198. /// </summary>
  199. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  200. {
  201. return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
  202. }
  203. /// <summary>
  204. /// 分页获取数据列表
  205. /// </summary>
  206. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  207. //{
  208. //return dal.GetList(PageSize,PageIndex,strWhere);
  209. //}
  210. #endregion BasicMethod
  211. #region ExtensionMethod
  212. #endregion ExtensionMethod
  213. }
  214. }