Exemplo n.º 1
0
        public WareHouse GetWareByID(string wareid, string clientid)
        {
            if (string.IsNullOrEmpty(wareid))
            {
                return null;
            }

            wareid = wareid.ToLower();
            clientid = clientid.ToLower();

            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();
                list.Add(model);
            }
            return model;
        }
Exemplo n.º 2
0
        public List<WareHouse> GetWareHouses(string clientID)
        {
            clientID = clientID.ToLower();

            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;
        }
Exemplo n.º 3
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;
        }
Exemplo n.º 4
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;
        }
Exemplo n.º 5
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;
        }