| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- using CallCenterApi.Model;
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace CallCenterApi.BLL
- {
- public class ManagementUser
- {
- private readonly DAL.ManagementUser dal = new DAL.ManagementUser();
- /// <summary>
- /// 获得数据列表
- /// </summary>
- public List<Model.ManagementUser> DataTableToList(DataTable dt)
- {
- List<Model.ManagementUser> modelList = new List<Model.ManagementUser>();
- int rowsCount = dt.Rows.Count;
- if (rowsCount > 0)
- {
- Model.ManagementUser model;
- for (int n = 0; n < rowsCount; n++)
- {
- model = dal.DataRowToModelarchives(dt.Rows[n]);
- if (model != null)
- {
- modelList.Add(model);
- }
- }
- }
- return modelList;
- }
- /// <summary>
- /// 根据Openid 获取用户
- /// </summary>
- /// <param name="openid"></param>
- /// <returns></returns>
- public Model.ManagementUser GetModelByOpenid(string openid)
- {
- return dal.GetModelByOpenid(openid);
- }
- /// <summary>
- /// 更新一条数据
- /// </summary>
- public bool Update(Model.ManagementUser model)
- {
- return dal.Update(model);
- }
- /// <summary>
- ///根据名称 得到一个对象实体
- /// </summary>
- public Model.ManagementUser GetModel(string username)
- {
- return dal.GetModel(username);
- }
- /// <summary>
- ///根据名称 得到一个对象实体
- /// </summary>
- public Model.ManagementUser GetModelname(string username)
- {
- return dal.GetModelname(username);
- }
- /// <summary>
- ///根据id 得到一个对象实体
- /// </summary>
- public Model.ManagementUser GetModels(int id)
- {
- return dal.GetModels(id);
- }
- /// <summary>
- /// 增加一条数据
- /// </summary>
- public int Add(Model.ManagementUser model)
- {
- return dal.Add(model);
- }
- /// <summary>
- /// 获得数据列表
- /// </summary>
- public List<Model.ManagementUser> GetModelList(string strWhere)
- {
- DataSet ds = dal.GetList(strWhere);
- return DataTableToList(ds.Tables[0]);
- }
-
- /// <summary>
- /// 删除一条管理员数据
- /// </summary>
- public bool DeleteList(string F_UserIdlist)
- {
- return dal.DeleteList(F_UserIdlist);
- }
- /// <summary>
- /// 获取管理员与客户关联信息
- /// </summary>
- /// <returns></returns>
- public DataSet GetManageCustomer()
- {
- return dal.GetManageCustomer();
- }
- /// <summary>
- /// 添加管理员与客户关联表数据
- /// </summary>
- /// <returns></returns>
- public int AddManageCustomer(ManageCustomer model)
- {
- return dal.AddManageCustomer(model);
- }
- /// <summary>
- /// 得到一个档案物资对象实体
- /// </summary>
- public CallCenterApi.Model.ManageCustomer GetManageCustomerModel(int id)
- {
- return dal.GetManageCustomerModel(id);
- }
- /// <summary>
- /// 修改管理员与客户关联数据
- /// </summary>
- /// <param name="model"></param>
- /// <returns></returns>
- public bool UpdateManageCustomer(ManageCustomer model)
- {
- return dal.UpdateManageCustomer(model);
- }
- /// <summary>
- /// 根据用户名密码得到一个对象实体
- /// </summary>
- public Model.ManagementUser GetManageCustomerModelwx(string username, string userpower)
- {
- return dal.GetManageCustomerModelwx(username,userpower);
- }
- /// <summary>
- /// 获得数据列表
- /// </summary>
- public List<CallCenterApi.Model.ManageCustomer> GetManageCustomerModelList(string strWhere)
- {
- DataSet ds = dal.GetmanagecustomerList(strWhere);
- return DataTableToList1(ds.Tables[0]);
- }
- /// <summary>
- /// 获得数据列表
- /// </summary>
- public List<Model.ManageCustomer> DataTableToList1(DataTable dt)
- {
- List<Model.ManageCustomer> modelList = new List<Model.ManageCustomer>();
- int rowsCount = dt.Rows.Count;
- if (rowsCount > 0)
- {
- Model.ManageCustomer model;
- for (int n = 0; n < rowsCount; n++)
- {
- model = dal.DataRowToModelarchives1(dt.Rows[n]);
- if (model != null)
- {
- modelList.Add(model);
- }
- }
- }
- return modelList;
- }
- /// <summary>
- /// 删除一条管理员与客户关联数据
- /// </summary>
- public bool DeleteManaList(string ids)
- {
- return dal.DeleteManaList(ids);
- }
- }
- }
|