Example #1
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);
        }
Example #2
0
        public List <ContactEntity> GetContactsByCustomerID(string customerid, string clientid)
        {
            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.ClientID);
                model.City       = CommonBusiness.Citys.Where(m => m.CityCode == model.CityCode).FirstOrDefault();
                list.Add(model);
            }

            return(list);
        }