Example #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.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);
        }
Example #2
0
        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);
        }
Example #3
0
        public DepotSeat GetDepotByID(string depotid)
        {
            DataTable dt = SystemDAL.BaseProvider.GetDepotByID(depotid);

            DepotSeat model = new DepotSeat();

            if (dt.Rows.Count > 0)
            {
                model.FillData(dt.Rows[0]);
            }
            return(model);
        }
Example #4
0
        /// <summary>
        /// 获取货位详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DepotSeat GetDepotByID(string depotid)
        {
            var       dal = new WarehouseDAL();
            DataTable dt  = dal.GetDepotByID(depotid);

            DepotSeat model = new DepotSeat();

            if (dt.Rows.Count > 0)
            {
                model.FillData(dt.Rows[0]);
            }
            return(model);
        }
Example #5
0
        public List <DepotSeat> GetDepotSeatsByWareID(string wareid, string clientid)
        {
            DataTable dt = SystemDAL.BaseProvider.GetDepotSeatsByWareID(wareid);

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

            foreach (DataRow dr in dt.Rows)
            {
                DepotSeat model = new DepotSeat();
                model.FillData(dr);
                list.Add(model);
            }
            return(list);
        }
Example #6
0
        /// <summary>
        /// 获取货位列表
        /// </summary>
        /// <param name="keyWords">关键词</param>
        /// <param name="pageSize">每页条数</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="totalCount">总记录数</param>
        /// <param name="pageCount">总页数</param>
        /// <param name="clientID">客户端ID</param>
        /// <returns></returns>
        public List <DepotSeat> GetDepotSeats(string keyWords, int pageSize, int pageIndex, ref int totalCount, ref int pageCount, string clientID, string wareid = "")
        {
            DataSet ds = SystemDAL.BaseProvider.GetDepotSeats(keyWords, pageSize, pageIndex, ref totalCount, ref pageCount, clientID, wareid);

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

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                DepotSeat model = new DepotSeat();
                model.FillData(dr);
                list.Add(model);
            }
            return(list);
        }
Example #7
0
        /// <summary>
        /// 根据仓库ID获取货位
        /// </summary>
        /// <param name="wareid"></param>
        /// <param name="clientid"></param>
        /// <returns></returns>
        public List <DepotSeat> GetDepotSeatsByWareID(string wareid, string clientid)
        {
            var       dal = new WarehouseDAL();
            DataTable dt  = dal.GetDepotSeatsByWareID(wareid);

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

            foreach (DataRow dr in dt.Rows)
            {
                DepotSeat model = new DepotSeat();
                model.FillData(dr);
                list.Add(model);
            }
            return(list);
        }
Example #8
0
        public JsonResult SaveDepotSeat(string obj)
        {
            JavaScriptSerializer serializer = new JavaScriptSerializer();
            DepotSeat            model      = serializer.Deserialize <DepotSeat>(obj);

            string id = string.Empty;

            if (string.IsNullOrEmpty(model.DepotID))
            {
                id = new SystemBusiness().AddDepotSeat(model.DepotCode, model.WareID, model.Name, model.Status, model.Description, CurrentUser.UserID, CurrentUser.ClientID);
            }
            else if (new SystemBusiness().UpdateDepotSeat(model.DepotID, model.WareID, model.DepotCode, model.Name, model.Status, model.Description, CurrentUser.UserID, CurrentUser.ClientID))
            {
                id = model.WareID;
            }


            JsonDictionary.Add("ID", id);
            return(new JsonResult
            {
                Data = JsonDictionary,
                JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }