Exemplo n.º 1
0
        public List<ProvidersEntity> GetProviders(string clientid)
        {
            DataTable dt = ProductsDAL.BaseProvider.GetProviders(clientid);

            List<ProvidersEntity> list = new List<ProvidersEntity>();
            foreach (DataRow dr in dt.Rows)
            {
                ProvidersEntity model = new ProvidersEntity();
                model.FillData(dr);
                list.Add(model);
            }
            return list;
        }
Exemplo n.º 2
0
        public ProvidersEntity GetProviderByID(string providerid)
        {
            DataTable dt = ProductsDAL.BaseProvider.GetProviderByID(providerid);

            ProvidersEntity model = new ProvidersEntity();
            if (dt.Rows.Count > 0)
            {
                model.FillData(dt.Rows[0]);
                model.City = CommonBusiness.Citys.Where(c => c.CityCode == model.CityCode).FirstOrDefault();
            }
            return model;
        }
Exemplo n.º 3
0
        public List<ProvidersEntity> GetProviders(string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientID)
        {
            var dal = new StockDAL();

            string where = " ClientID='" + clientID + "' and Status<>9";
            if (!string.IsNullOrEmpty(keyWords))
            {
                where += " and (Name like '%" + keyWords + "%' or Contact like '%" + keyWords + "%' or MobileTele like '%" + keyWords + "%') ";
            }

            DataTable dt = CommonBusiness.GetPagerData("Providers", "*", where, "AutoID", pageSize, pageIndex, out totalCount, out pageCount);

            List<ProvidersEntity> list = new List<ProvidersEntity>();
            foreach (DataRow dr in dt.Rows)
            {
                ProvidersEntity model = new ProvidersEntity();
                model.FillData(dr);
                model.City = CommonBusiness.Citys.Where(c => c.CityCode == model.CityCode).FirstOrDefault();
                list.Add(model);
            }
            return list;
        }