// GET: InventoryRecord
        public ActionResult Index()
        {
            long hotelId = UserContext.CurrentUser.HotelId;

            ViewData["warehourse"] = WarehouseBll.GetAllList(hotelId);
            return(View());
        }
Esempio n. 2
0
        public JsonResult Save(RefundArgs model)
        {
            long hotelId   = UserContext.CurrentUser.HotelId;
            var  apiResult = new APIResult();

            try
            {
                StockOrder stock = model.Item1;
                stock.DType = Model.Enum.DocumentTypeEnum.退货;
                stock.StockOrderDetailsList = model.Item2;

                StockOrderBll.AddOrUpdate(stock, UserContext.CurrentUser.Name, hotelId);

                ViewData["supplier"]   = SupplierBll.GetAllList(hotelId);
                ViewData["warehourse"] = WarehouseBll.GetAllList(hotelId);
            }
            catch (Exception ex)
            {
                apiResult.Ret = -1;
                apiResult.Msg = ex.Message;
                if (!(ex is OperationExceptionFacade))
                {
                    LogFactory.GetLogger().Log(LogLevel.Error, ex);
                }
            }

            return(Json(apiResult));
        }
        // GET: Stock
        public ActionResult Index()
        {
            long hotelId = UserContext.CurrentUser.HotelId;
            List <CommodityType>  comTypeList = CommodityTypeBll.GetList(hotelId);
            List <SelectListItem> typeItems   = new List <SelectListItem>();

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

            ViewData["commodityTypeList"] = typeItems;
            ViewData["warehouse"]         = WarehouseBll.GetAllList(hotelId);
            return(View());
        }
Esempio n. 4
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));
        }
        public ActionResult Preview(long id = 0)
        {
            long hotelId = UserContext.CurrentUser.HotelId;

            ViewData["warehourse"] = WarehouseBll.GetAllList(hotelId);
            if (id == 0)
            {
                return(View(new InventoryRecordArgs()
                {
                    Item1 = new InventoryRecord(), Item2 = new List <InventoryRecordDetails>()
                }));
            }


            InventoryRecord model = InventoryRecordBll.GetById(id);
            var             info  = new InventoryRecordArgs
            {
                Item1 = model,
                Item2 = model.InventoryRecordDetailsList
            };

            return(View(info));
        }
Esempio n. 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 RefundArgs()
                {
                    Item1 = new StockOrder(), Item2 = new List <StockOrderDetails>()
                }));
            }

            StockOrder model = StockOrderBll.GetById(id);
            var        info  = new RefundArgs
            {
                Item1 = model,
                Item2 = model.StockOrderDetailsList,
            };

            return(View(info));
        }
        public ActionResult Preview(long id = 0)
        {
            long hotelId = UserContext.CurrentUser.HotelId;

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


            StockOrder model = StockOrderBll.GetById(id);
            var        info  = new TransferStockArgs
            {
                Item1 = model,
                Item2 = model.StockOrderDetailsList.FindAll(it => it.DType == DocumentTypeEnum.调拨入库),
            };

            return(View(info));
        }