Ejemplo n.º 1
0
 public List<ContactEntity> GetContactsByCustomerID(string ownerID, string customerid = "", string agentid = "")
 {
     int total = 0;
     List<ContactEntity> list = new List<ContactEntity>(); 
     string cloumns = " status<>9 and OwnerID='" + ownerID + "'";
     if (!string.IsNullOrEmpty(agentid))
     {
         cloumns += " and agentid='" + agentid + "'";
     }
     if (!string.IsNullOrEmpty(customerid))
     {
         cloumns += " and customerid='" + customerid + "'";
     }
     DataTable dt = CommonBusiness.GetPagerData("Contact", "*", cloumns, "CustomerID", int.MaxValue, 1, out total, out total);
     foreach (DataRow dr in dt.Rows)
     {
         ContactEntity model = new ContactEntity();
         model.FillData(dr);
         list.Add(model);
     }
     return list;
 }
Ejemplo n.º 2
0
 public ContactEntity GetContactByID(string contactid)
 {
     ContactEntity model = new ContactEntity();
     DataTable dt = CustomDAL.BaseProvider.GetContactByID(contactid);
     if (dt.Rows.Count > 0)
     {
         model.FillData(dt.Rows[0]);
     }
     return model;
 }
Ejemplo n.º 3
0
        public List<ContactEntity> GetContactsByCustomerID(string customerid, string agentid)
        {
            List<ContactEntity> list = new List<ContactEntity>();

            DataTable dt = CustomDAL.BaseProvider.GetContactsByCustomerID(customerid);
            foreach (DataRow dr in dt.Rows)
            {
                ContactEntity model = new ContactEntity();
                model.FillData(dr);
                model.CreateUser = OrganizationBusiness.GetUserByUserID(model.CreateUserID, model.AgentID);
                model.City = CommonBusiness.Citys.Where(m => m.CityCode == model.CityCode).FirstOrDefault();
                list.Add(model);
            }

            return list;
        }