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();
///
/// 获得数据列表
///
public List DataTableToList(DataTable dt)
{
List modelList = new List();
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;
}
///
/// 根据Openid 获取用户
///
///
///
public Model.ManagementUser GetModelByOpenid(string openid)
{
return dal.GetModelByOpenid(openid);
}
///
/// 更新一条数据
///
public bool Update(Model.ManagementUser model)
{
return dal.Update(model);
}
///
///根据名称 得到一个对象实体
///
public Model.ManagementUser GetModel(string username)
{
return dal.GetModel(username);
}
///
///根据名称 得到一个对象实体
///
public Model.ManagementUser GetModelname(string username)
{
return dal.GetModelname(username);
}
///
///根据id 得到一个对象实体
///
public Model.ManagementUser GetModels(int id)
{
return dal.GetModels(id);
}
///
/// 增加一条数据
///
public int Add(Model.ManagementUser model)
{
return dal.Add(model);
}
///
/// 获得数据列表
///
public List GetModelList(string strWhere)
{
DataSet ds = dal.GetList(strWhere);
return DataTableToList(ds.Tables[0]);
}
///
/// 删除一条管理员数据
///
public bool DeleteList(string F_UserIdlist)
{
return dal.DeleteList(F_UserIdlist);
}
///
/// 获取管理员与客户关联信息
///
///
public DataSet GetManageCustomer()
{
return dal.GetManageCustomer();
}
///
/// 添加管理员与客户关联表数据
///
///
public int AddManageCustomer(ManageCustomer model)
{
return dal.AddManageCustomer(model);
}
///
/// 得到一个档案物资对象实体
///
public CallCenterApi.Model.ManageCustomer GetManageCustomerModel(int id)
{
return dal.GetManageCustomerModel(id);
}
///
/// 修改管理员与客户关联数据
///
///
///
public bool UpdateManageCustomer(ManageCustomer model)
{
return dal.UpdateManageCustomer(model);
}
///
/// 根据用户名密码得到一个对象实体
///
public Model.ManagementUser GetManageCustomerModelwx(string username, string userpower)
{
return dal.GetManageCustomerModelwx(username,userpower);
}
///
/// 获得数据列表
///
public List GetManageCustomerModelList(string strWhere)
{
DataSet ds = dal.GetmanagecustomerList(strWhere);
return DataTableToList1(ds.Tables[0]);
}
///
/// 获得数据列表
///
public List DataTableToList1(DataTable dt)
{
List modelList = new List();
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;
}
///
/// 删除一条管理员与客户关联数据
///
public bool DeleteManaList(string ids)
{
return dal.DeleteManaList(ids);
}
}
}