Пример #1
0
        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.StageStatusStr = CommonBusiness.GetEnumDesc<EnumCustomStageStatus>((EnumCustomStageStatus)model.StageStatus);
                //model.Stage = SystemBusiness.BaseBusiness.GetCustomStageByID(model.StageID, model.AgentID, model.ClientID);
                list.Add(model);
            }
            return list;
        }
Пример #2
0
        public List<CustomerEntity> GetCustomers(EnumSearchType searchtype, int type, string sourceid, string stageid, int status, int mark, string activityid, string searchuserid, string searchteamid, string searchagentid,
                                                 string begintime, string endtime, 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>();
            DataTable dt = GetCustomersDatable(searchtype, type, sourceid, stageid, status, mark, activityid, searchuserid, searchteamid, searchagentid, begintime, endtime, 
                                                                keyWords, orderby, pageSize, pageIndex, ref totalCount, ref pageCount, userid, agentid, clientid);
            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.StageStatusStr = CommonBusiness.GetEnumDesc<EnumCustomStageStatus>((EnumCustomStageStatus)model.StageStatus);
                model.City = CommonBusiness.GetCityByCode(model.CityCode);
                list.Add(model);
            }
            return list;
        }
Пример #3
0
 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.StageStatusStr = CommonBusiness.GetEnumDesc<EnumCustomStageStatus>((EnumCustomStageStatus)model.StageStatus);
         //model.Stage = SystemBusiness.BaseBusiness.GetCustomStageByID(model.StageID, model.AgentID, model.ClientID);
         list.Add(model);
     }
     return list;
 }
Пример #4
0
        public List<CustomerEntity> GetCustomerByOwneID(string ownerID, string agentid="", string clientid="")
        {
            int total = 0;
            List<CustomerEntity> list=new List<CustomerEntity>();
            string cloumns = " status<>9 and OwnerID='" + ownerID + "'";
            if (!string.IsNullOrEmpty(agentid))
            {
                cloumns += " and agentid='" +agentid+ "'";
            } 
            if (!string.IsNullOrEmpty(clientid))
            {
                cloumns += " and clientid='" + clientid + "'";
            }

           DataTable dt = CommonBusiness.GetPagerData("Customer", "*", cloumns, "CustomerID", int.MaxValue, 1, out total, out total);
           foreach (DataRow dr in dt.Rows)
           {
               CustomerEntity model = new CustomerEntity();
               model.FillData(dr); 
               list.Add(model);
           }
            return list;
        }
Пример #5
0
        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.Source = SystemBusiness.BaseBusiness.GetCustomSourcesByID(model.SourceID, model.AgentID, model.ClientID);
                model.StageStatusStr = CommonBusiness.GetEnumDesc<EnumCustomStageStatus>((EnumCustomStageStatus)model.StageStatus);

                if (model.Extent > 0)
                {
                    model.ExtentStr = GetExtents().Where(m => m.ExtentID == model.Extent.ToString()).FirstOrDefault().ExtentName;
                }

                model.City = CommonBusiness.Citys.Where(m => m.CityCode == model.CityCode).FirstOrDefault();

                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID);

                if (!string.IsNullOrEmpty(model.IndustryID))
                {
                    model.Industry = SystemBusiness.BaseBusiness.GetClientIndustryByID(model.IndustryID, model.AgentID, model.ClientID);
                }
                if (ds.Tables["Activity"].Rows.Count > 0)
                {
                    model.Activity = new ActivityEntity();
                    model.Activity.FillData(ds.Tables["Activity"].Rows[0]);
                }

                //if (ds.Tables["Contact"].Rows.Count > 0)
                //{
                //    model.Contacts = new List<ContactEntity>();
                //    foreach (DataRow dr in ds.Tables["Contact"].Rows)
                //    {
                //        ContactEntity con = new ContactEntity();
                //        con.FillData(dr);
                //        model.Contacts.Add(con);
                //    }
                    
                //}
            }
            return model;
        }
Пример #6
0
        public List<CustomerEntity> GetCustomers(EnumSearchType searchtype, int type, string sourceid, string stageid, int status, int mark, string activityid, string searchuserid, string searchteamid, string searchagentid,
                                                 string begintime, string endtime, string keyWords, 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, sourceid, stageid, status, mark, activityid, searchuserid, searchteamid, searchagentid, begintime, endtime, keyWords, 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.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;
        }