Exemplo n.º 1
0
        /// <summary>
        /// 构建tree树
        /// </summary>
        /// <returns></returns>
        public string GetTreeView()
        {
            List <CommodityType> comTypeList = CommodityTypeBll.GetList(UserContext.CurrentUser.HotelId);
            TreeNode             rootNode    = new TreeNode()
            {
                id       = 0,
                text     = "全部分类",
                state    = "open",
                children = findTreeChildren(comTypeList, 0)
            };

            var result = JsonConvert.SerializeObject(rootNode);

            return($"[{result}]");
        }
Exemplo n.º 2
0
        public ActionResult _RefundSearch()
        {
            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()
                });
            }

            ViewData["commodityTypeList"] = typeItems;
            return(View());
        }
Exemplo n.º 3
0
        // 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());
        }
Exemplo n.º 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());
        }
Exemplo n.º 5
0
        public ActionResult Edit(long id = 0)
        {
            List <CommodityType>  comTypeList = CommodityTypeBll.GetList(UserContext.CurrentUser.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;

            List <CommodityUnit>  comUnitList = CommodityUnitBll.GetList(UserContext.CurrentUser.HotelId);
            List <SelectListItem> unitItems   = new List <SelectListItem>();

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

            ViewData["commodityUnitList"] = unitItems;

            if (id == 0)
            {
                return(View(new Hotel.Model.Inventory.Commodity()
                {
                    HotelId = UserContext.CurrentUser.HotelId
                }));
            }

            var info = CommodityBll.GetById(id);

            return(View(info));
        }