三元财务API

ManagementUser.cs 5.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. using CallCenterApi.Model;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Data;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace CallCenterApi.BLL
  9. {
  10. public class ManagementUser
  11. {
  12. private readonly DAL.ManagementUser dal = new DAL.ManagementUser();
  13. /// <summary>
  14. /// 获得数据列表
  15. /// </summary>
  16. public List<Model.ManagementUser> DataTableToList(DataTable dt)
  17. {
  18. List<Model.ManagementUser> modelList = new List<Model.ManagementUser>();
  19. int rowsCount = dt.Rows.Count;
  20. if (rowsCount > 0)
  21. {
  22. Model.ManagementUser model;
  23. for (int n = 0; n < rowsCount; n++)
  24. {
  25. model = dal.DataRowToModelarchives(dt.Rows[n]);
  26. if (model != null)
  27. {
  28. modelList.Add(model);
  29. }
  30. }
  31. }
  32. return modelList;
  33. }
  34. /// <summary>
  35. /// 根据Openid 获取用户
  36. /// </summary>
  37. /// <param name="openid"></param>
  38. /// <returns></returns>
  39. public Model.ManagementUser GetModelByOpenid(string openid)
  40. {
  41. return dal.GetModelByOpenid(openid);
  42. }
  43. /// <summary>
  44. /// 更新一条数据
  45. /// </summary>
  46. public bool Update(Model.ManagementUser model)
  47. {
  48. return dal.Update(model);
  49. }
  50. /// <summary>
  51. ///根据名称 得到一个对象实体
  52. /// </summary>
  53. public Model.ManagementUser GetModel(string username)
  54. {
  55. return dal.GetModel(username);
  56. }
  57. /// <summary>
  58. ///根据名称 得到一个对象实体
  59. /// </summary>
  60. public Model.ManagementUser GetModelname(string username)
  61. {
  62. return dal.GetModelname(username);
  63. }
  64. /// <summary>
  65. ///根据id 得到一个对象实体
  66. /// </summary>
  67. public Model.ManagementUser GetModels(int id)
  68. {
  69. return dal.GetModels(id);
  70. }
  71. /// <summary>
  72. /// 增加一条数据
  73. /// </summary>
  74. public int Add(Model.ManagementUser model)
  75. {
  76. return dal.Add(model);
  77. }
  78. /// <summary>
  79. /// 获得数据列表
  80. /// </summary>
  81. public List<Model.ManagementUser> GetModelList(string strWhere)
  82. {
  83. DataSet ds = dal.GetList(strWhere);
  84. return DataTableToList(ds.Tables[0]);
  85. }
  86. /// <summary>
  87. /// 删除一条管理员数据
  88. /// </summary>
  89. public bool DeleteList(string F_UserIdlist)
  90. {
  91. return dal.DeleteList(F_UserIdlist);
  92. }
  93. /// <summary>
  94. /// 获取管理员与客户关联信息
  95. /// </summary>
  96. /// <returns></returns>
  97. public DataSet GetManageCustomer()
  98. {
  99. return dal.GetManageCustomer();
  100. }
  101. /// <summary>
  102. /// 添加管理员与客户关联表数据
  103. /// </summary>
  104. /// <returns></returns>
  105. public int AddManageCustomer(ManageCustomer model)
  106. {
  107. return dal.AddManageCustomer(model);
  108. }
  109. /// <summary>
  110. /// 得到一个档案物资对象实体
  111. /// </summary>
  112. public CallCenterApi.Model.ManageCustomer GetManageCustomerModel(int id)
  113. {
  114. return dal.GetManageCustomerModel(id);
  115. }
  116. /// <summary>
  117. /// 修改管理员与客户关联数据
  118. /// </summary>
  119. /// <param name="model"></param>
  120. /// <returns></returns>
  121. public bool UpdateManageCustomer(ManageCustomer model)
  122. {
  123. return dal.UpdateManageCustomer(model);
  124. }
  125. /// <summary>
  126. /// 根据用户名密码得到一个对象实体
  127. /// </summary>
  128. public Model.ManagementUser GetManageCustomerModelwx(string username, string userpower)
  129. {
  130. return dal.GetManageCustomerModelwx(username,userpower);
  131. }
  132. /// <summary>
  133. /// 获得数据列表
  134. /// </summary>
  135. public List<CallCenterApi.Model.ManageCustomer> GetManageCustomerModelList(string strWhere)
  136. {
  137. DataSet ds = dal.GetmanagecustomerList(strWhere);
  138. return DataTableToList1(ds.Tables[0]);
  139. }
  140. /// <summary>
  141. /// 获得数据列表
  142. /// </summary>
  143. public List<Model.ManageCustomer> DataTableToList1(DataTable dt)
  144. {
  145. List<Model.ManageCustomer> modelList = new List<Model.ManageCustomer>();
  146. int rowsCount = dt.Rows.Count;
  147. if (rowsCount > 0)
  148. {
  149. Model.ManageCustomer model;
  150. for (int n = 0; n < rowsCount; n++)
  151. {
  152. model = dal.DataRowToModelarchives1(dt.Rows[n]);
  153. if (model != null)
  154. {
  155. modelList.Add(model);
  156. }
  157. }
  158. }
  159. return modelList;
  160. }
  161. /// <summary>
  162. /// 删除一条管理员与客户关联数据
  163. /// </summary>
  164. public bool DeleteManaList(string ids)
  165. {
  166. return dal.DeleteManaList(ids);
  167. }
  168. }
  169. }