public List<CustomerEntity> GetCustomers(EnumSearchType searchtype, int type, int sourcetype, string sourceid, string stageid, int status, int mark, string activityid, string searchuserid, string searchteamid, string searchagentid, string begintime, string endtime, string firstname, string keyWords, string orderBy, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string userid, string agentid, string clientid) { List<CustomerEntity> list = new List<CustomerEntity>(); DataSet ds = CustomDAL.BaseProvider.GetCustomers((int)searchtype, type, sourcetype, sourceid, stageid, status, mark, activityid, searchuserid, searchteamid, searchagentid, begintime, endtime, firstname, keyWords, orderBy, pageSize, pageIndex, ref totalCount, ref pageCount, userid, agentid, clientid); foreach (DataRow dr in ds.Tables[0].Rows) { CustomerEntity model = new CustomerEntity(); model.FillData(dr); model.Owner = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID); model.City = CommonBusiness.Citys.Where(m => m.CityCode == model.CityCode).FirstOrDefault(); list.Add(model); } return list; }
public List<CustomerEntity> GetCustomersByActivityID(string activityid, int pageSize, int pageIndex, ref int totalCount, ref int pageCount) { List<CustomerEntity> list = new List<CustomerEntity>(); string sqlWhere = " ActivityID='" + activityid + "' and status<>9"; DataTable dt = CommonBusiness.GetPagerData("Customer", "*", sqlWhere, "CustomerID", pageSize, pageIndex, out totalCount, out pageCount); foreach (DataRow dr in dt.Rows) { CustomerEntity model = new CustomerEntity(); model.FillData(dr); model.Owner = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID); model.Source = SystemBusiness.BaseBusiness.GetCustomSourcesByID(model.SourceID, model.AgentID, model.ClientID); model.Stage = SystemBusiness.BaseBusiness.GetCustomStageByID(model.StageID, model.AgentID, model.ClientID); list.Add(model); } return list; }
public CustomerEntity GetCustomerByID(string customerid, string agentid, string clientid) { DataSet ds = CustomDAL.BaseProvider.GetCustomerByID(customerid, agentid, clientid); CustomerEntity model = new CustomerEntity(); if (ds.Tables["Customer"].Rows.Count > 0) { model.FillData(ds.Tables["Customer"].Rows[0]); model.Owner = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID); model.City = CommonBusiness.Citys.Where(m => m.CityCode == model.CityCode).FirstOrDefault(); model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID); } return model; }
public CustomerEntity GetCustomerByMobilePhone(string mobilePhone, string clientid,string name) { DataSet ds = CustomDAL.BaseProvider.GetCustomerByMobilePhone(mobilePhone, clientid,name); CustomerEntity model = new CustomerEntity(); if (ds.Tables["Customer"].Rows.Count > 0) { model.FillData(ds.Tables["Customer"].Rows[0]); } return model; }
public List<CustomerEntity> GetCustomersByKeywords(string keywords, string userid, string agentid, string clientid) { List<CustomerEntity> list = new List<CustomerEntity>(); DataSet ds = CustomDAL.BaseProvider.GetCustomersByKeywords(keywords, userid, agentid, clientid); foreach (DataRow dr in ds.Tables[0].Rows) { CustomerEntity model = new CustomerEntity(); model.FillData(dr); model.Owner = OrganizationBusiness.GetUserByUserID(model.OwnerID, model.AgentID); model.Source = SystemBusiness.BaseBusiness.GetCustomSourcesByID(model.SourceID, model.AgentID, model.ClientID); //model.Stage = SystemBusiness.BaseBusiness.GetCustomStageByID(model.StageID, model.AgentID, model.ClientID); list.Add(model); } return list; }