예제 #1
0
        // GET: Items/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction("Error", "Home"));
            }
            Supplier Supplier = _supplierBll.GetById(id);

            if (Supplier == null)
            {
                return(RedirectToAction("Error", "Home"));
            }
            return(View(Supplier));
        }
예제 #2
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));
        }
        public ActionResult Edit(long id = 0)
        {
            List <SupplierType>   supTypeList = SupplierTypeBll.GetList(UserContext.CurrentUser.HotelId);
            List <SelectListItem> items       = new List <SelectListItem>();

            foreach (var item in supTypeList)
            {
                items.Add(new SelectListItem {
                    Text = item.Name, Value = item.Id.ToString()
                });
            }
            ViewData["hotelTypeList"] = items;
            if (id == 0)
            {
                return(View(new Hotel.Model.Inventory.Supplier()
                {
                    HotelId = UserContext.CurrentUser.HotelId
                }));
            }
            var info = SupplierBll.GetById(id);

            return(View(info));
        }