思念食品API

T_Sys_UserAccount.cs 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  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 LoginGetModel(string F_UserCode, string F_Password)
  85. {
  86. return dal.LoginGetModel(F_UserCode, F_Password);
  87. }
  88. ///// <summary>
  89. ///// 得到一个对象实体,从缓存中
  90. ///// </summary>
  91. //public Model.T_Sys_UserAccount GetModelByCache(int F_UserId)
  92. //{
  93. // string CacheKey = "T_Sys_UserAccountModel-" + F_UserId;
  94. // object objModel = Maticsoft.Common.DataCache.GetCache(CacheKey);
  95. // if (objModel == null)
  96. // {
  97. // try
  98. // {
  99. // objModel = dal.GetModel(F_UserId);
  100. // if (objModel != null)
  101. // {
  102. // int ModelCache = Maticsoft.Common.ConfigHelper.GetConfigInt("ModelCache");
  103. // Maticsoft.Common.DataCache.SetCache(CacheKey, objModel, DateTime.Now.AddMinutes(ModelCache), TimeSpan.Zero);
  104. // }
  105. // }
  106. // catch{}
  107. // }
  108. // return (Model.T_Sys_UserAccount)objModel;
  109. //}
  110. /// <summary>
  111. /// 获得数据列表
  112. /// </summary>
  113. public DataSet GetList(string strWhere)
  114. {
  115. return dal.GetList(strWhere);
  116. }
  117. public DataSet GetListView(string strWhere)
  118. {
  119. return dal.GetListView(strWhere);
  120. }
  121. /// <summary>
  122. /// 获得前几行数据
  123. /// </summary>
  124. public DataSet GetList(int Top, string strWhere, string filedOrder)
  125. {
  126. return dal.GetList(Top, strWhere, filedOrder);
  127. }
  128. /// <summary>
  129. /// 获得数据列表
  130. /// </summary>
  131. public List<Model.T_Sys_UserAccount> GetModelList(string strWhere)
  132. {
  133. DataSet ds = dal.GetList(strWhere);
  134. return DataTableToList(ds.Tables[0]);
  135. }
  136. /// <summary>
  137. /// 获得数据列表
  138. /// </summary>
  139. public List<Model.T_Sys_UserAccount> DataTableToList(DataTable dt)
  140. {
  141. List<Model.T_Sys_UserAccount> modelList = new List<Model.T_Sys_UserAccount>();
  142. int rowsCount = dt.Rows.Count;
  143. if (rowsCount > 0)
  144. {
  145. Model.T_Sys_UserAccount model;
  146. for (int n = 0; n < rowsCount; n++)
  147. {
  148. model = dal.DataRowToModel(dt.Rows[n]);
  149. if (model != null)
  150. {
  151. modelList.Add(model);
  152. }
  153. }
  154. }
  155. return modelList;
  156. }
  157. public List<Model.T_Sys_UserAccount> DataTableToList1(DataTable dt)
  158. {
  159. List<Model.T_Sys_UserAccount> modelList = new List<Model.T_Sys_UserAccount>();
  160. int rowsCount = dt.Rows.Count;
  161. if (rowsCount > 0)
  162. {
  163. Model.T_Sys_UserAccount model;
  164. for (int n = 0; n < rowsCount; n++)
  165. {
  166. model = dal.DataRowToModel1(dt.Rows[n]);
  167. if (model != null)
  168. {
  169. modelList.Add(model);
  170. }
  171. }
  172. }
  173. return modelList;
  174. }
  175. /// <summary>
  176. /// 获得数据列表
  177. /// </summary>
  178. public DataSet GetAllList()
  179. {
  180. return GetList("");
  181. }
  182. /// <summary>
  183. /// 分页获取数据列表
  184. /// </summary>
  185. public int GetRecordCount(string strWhere)
  186. {
  187. return dal.GetRecordCount(strWhere);
  188. }
  189. /// <summary>
  190. /// 分页获取数据列表
  191. /// </summary>
  192. public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
  193. {
  194. return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
  195. }
  196. /// <summary>
  197. /// 分页获取数据列表
  198. /// </summary>
  199. //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
  200. //{
  201. //return dal.GetList(PageSize,PageIndex,strWhere);
  202. //}
  203. #endregion BasicMethod
  204. #region ExtensionMethod
  205. #endregion ExtensionMethod
  206. }
  207. }