コード例 #1
0
        public WareHouse GetWareByID(string wareid, string clientid)
        {
            if (string.IsNullOrEmpty(wareid))
            {
                return(null);
            }

            var list = GetWareHouses(clientid);

            if (list.Where(m => m.WareID == wareid).Count() > 0)
            {
                return(list.Where(m => m.WareID == wareid).FirstOrDefault());
            }

            DataTable dt = SystemDAL.BaseProvider.GetWareByID(wareid);

            WareHouse model = new WareHouse();

            if (dt.Rows.Count > 0)
            {
                model.FillData(dt.Rows[0]);
                model.City = CommonBusiness.Citys.Where(c => c.CityCode == model.CityCode).FirstOrDefault();
                WareHouses[clientid].Add(model);
            }


            return(model);
        }
コード例 #2
0
ファイル: SystemBusiness.cs プロジェクト: Michauxquan/MTest
        public WareHouse GetWareByID(string wareid, string clientid)
        {
            if (string.IsNullOrEmpty(wareid))
            {
                return(null);
            }

            var list = GetWareHouses(clientid);

            if (list.Where(m => m.WareID.ToLower() == wareid.ToLower()).Count() > 0)
            {
                return(list.Where(m => m.WareID == wareid).FirstOrDefault());
            }

            DataSet ds = SystemDAL.BaseProvider.GetWareByID(wareid);

            WareHouse model = new WareHouse();

            if (ds.Tables[0].Rows.Count > 0)
            {
                model.FillData(ds.Tables[0].Rows[0]);
                model.City       = CommonBusiness.Citys.Where(c => c.CityCode == model.CityCode).FirstOrDefault();
                model.DepotSeats = new List <DepotSeat>();
                foreach (DataRow item in ds.Tables[1].Rows)
                {
                    DepotSeat depot = new DepotSeat();
                    depot.FillData(item);
                    model.DepotSeats.Add(depot);
                }
                WareHouses[clientid].Add(model);
            }

            return(model);
        }
コード例 #3
0
ファイル: SystemBusiness.cs プロジェクト: Michauxquan/MTest
        public List <WareHouse> GetWareHouses(string clientid)
        {
            if (WareHouses.ContainsKey(clientid))
            {
                return(WareHouses[clientid]);
            }

            DataSet ds = SystemDAL.BaseProvider.GetWareHouses(clientid);

            List <WareHouse> list = new List <WareHouse>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                WareHouse model = new WareHouse();
                model.FillData(dr);
                model.City       = CommonBusiness.Citys.Where(c => c.CityCode == model.CityCode).FirstOrDefault();
                model.DepotSeats = new List <DepotSeat>();
                foreach (var item in ds.Tables[1].Select("WareID='" + model.WareID + "'"))
                {
                    DepotSeat depot = new DepotSeat();
                    depot.FillData(item);
                    model.DepotSeats.Add(depot);
                }
                list.Add(model);
            }
            WareHouses.Add(clientid, list);
            return(list);
        }
コード例 #4
0
        /// <summary>
        /// 根据ID获取仓库详情
        /// </summary>
        /// <param name="wareid"></param>
        /// <returns></returns>
        public WareHouse GetWareByID(string wareid)
        {
            var       dal = new WarehouseDAL();
            DataTable dt  = dal.GetWareByID(wareid);

            WareHouse model = new WareHouse();

            if (dt.Rows.Count > 0)
            {
                model.FillData(dt.Rows[0]);
                model.City = CommonBusiness.Citys.Where(c => c.CityCode == model.CityCode).FirstOrDefault();
            }
            return(model);
        }
コード例 #5
0
        /// <summary>
        /// 获取所有仓库(ID和Name)
        /// </summary>
        /// <param name="clientID"></param>
        /// <returns></returns>
        public List <WareHouse> GetWareHouses(string clientID)
        {
            var       dal = new WarehouseDAL();
            DataTable dt  = dal.GetWareHouses(clientID);

            List <WareHouse> list = new List <WareHouse>();

            foreach (DataRow dr in dt.Rows)
            {
                WareHouse model = new WareHouse();
                model.FillData(dr);
                list.Add(model);
            }
            return(list);
        }
コード例 #6
0
        public List <WareHouse> GetWareHouses(string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientID)
        {
            DataSet ds = SystemDAL.BaseProvider.GetWareHouses(keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, clientID);

            List <WareHouse> list = new List <WareHouse>();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                WareHouse model = new WareHouse();
                model.FillData(dr);
                model.City = CommonBusiness.Citys.Where(c => c.CityCode == model.CityCode).FirstOrDefault();
                list.Add(model);
            }
            return(list);
        }
コード例 #7
0
        public List <WareHouse> GetWareHouses(string clientID)
        {
            if (WareHouses.ContainsKey(clientID))
            {
                return(WareHouses[clientID]);
            }

            DataTable dt = SystemDAL.BaseProvider.GetWareHouses(clientID);

            List <WareHouse> list = new List <WareHouse>();

            foreach (DataRow dr in dt.Rows)
            {
                WareHouse model = new WareHouse();
                model.FillData(dr);
                list.Add(model);
            }
            WareHouses.Add(clientID, list);
            return(list);
        }