Brak opisu

T_Sys_UserAccount.cs 6.7KB

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