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; }
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; }