public ActionResult Edit(long id = 0)
        {
            if (id == 0)
            {
                return(View(new Hotel.Model.Inventory.Warehouse()));
            }
            var info = WarehouseBll.GetById(id);

            return(View(info));
        }
        public string getById(long id)
        {
            InventoryRecord model = InventoryRecordBll.GetById(id);

            if (model != null)
            {
                var warehourse = WarehouseBll.GetById(model.WarehourseId);

                model.WarehourseName = warehourse == null ? "" : warehourse.Name;
            }

            return(JsonConvert.SerializeObject(model));
        }
        public string getById(long id)
        {
            StockOrder model = StockOrderBll.GetById(id);

            if (model != null)
            {
                var recallWarehourse   = WarehouseBll.GetById(model.FromWarehourseId);
                var transferWarehourse = WarehouseBll.GetById(model.ToWarehourseId);

                model.FromWarehourseName = recallWarehourse == null ? "" : recallWarehourse.Name;
                model.ToWarehourseName   = transferWarehourse == null ? "" : transferWarehourse.Name;
            }

            return(JsonConvert.SerializeObject(model));
        }
Exemple #4
0
        /// <summary>
        /// 出库单商品列表页面
        /// </summary>
        /// <returns></returns>
        public ActionResult _OutStockSearch(long warehourseid)
        {
            List <SelectListItem> typeItems   = new List <SelectListItem>();
            List <CommodityType>  comTypeList = CommodityTypeBll.GetList(UserContext.CurrentUser.HotelId);

            foreach (var item in comTypeList)
            {
                typeItems.Add(new SelectListItem {
                    Text = item.Name, Value = item.Id.ToString()
                });
            }
            Warehouse house = WarehouseBll.GetById(warehourseid);

            if (house == null)
            {
                warehourseid = 0;
            }
            ViewData["commodityTypeList"] = typeItems;
            ViewData["warehourseid"]      = warehourseid;
            return(View());
        }
Exemple #5
0
        public string GetById(long id)
        {
            StockOrder model = StockOrderBll.GetById(id);

            if (model != null)
            {
                var supply     = SupplierBll.GetById(model.SupplierId);
                var warehourse = WarehouseBll.GetById(model.FromWarehourseId);

                if (supply != null)
                {
                    model.SupplierName = supply.Name;
                }
                if (warehourse != null)
                {
                    model.FromWarehourseName = warehourse.Name;
                }
            }

            return(JsonConvert.SerializeObject(model));
        }
Exemple #6
0
        public ActionResult Preview(long id = 0)
        {
            long hotelId = UserContext.CurrentUser.HotelId;

            ViewData["supplier"]   = SupplierBll.GetAllList(hotelId);
            ViewData["warehourse"] = WarehouseBll.GetAllList(hotelId);
            if (id == 0)
            {
                return(View(new OutStockArgs()
                {
                    Item1 = new StockOrder(), Item2 = new List <StockOrderDetails>()
                }));
            }

            StockOrder model = StockOrderBll.GetById(id);

            Warehouse house         = WarehouseBll.GetById(model.FromWarehourseId);
            string    WarehouseName = house?.Name;

            //给详情附上仓库名字
            List <StockOrderDetails> list = model.StockOrderDetailsList;

            if (list != null && list.Count > 0)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    list[i].WarehouseName = WarehouseName;
                }
            }

            var info = new OutStockArgs
            {
                Item1 = model,
                Item2 = list,
            };

            return(View(info));
        }