Пример #1
0
        public ActionResult EditDetail(int id)
        {
            //Guid detailUid = Guid.Parse(detailUidString);
            var model = InventoryInDetailSessionWrapper.GetDetail(id);

            return(PartialView("CreateEditDetail", model));
        }
Пример #2
0
        public ActionResult EditDetail(InventoryDetailEntryViewModel model, FormCollection form)
        {
            InventoryInDetailSessionWrapper.UpdateDetail(model);
            //var summary = OrderDetailSessionWrapper.CalculateSummary();
            var ajaxViewModel = new AjaxViewModel(message: "Order detail has been updated.");

            return(Json(ajaxViewModel));
        }
Пример #3
0
        // GET: Inventory/WarehouseIN/Create
        public ActionResult Create()
        {
            var model = new CreateEditViewModel();

            model.InventoryNo   = "NEW";
            model.InventoryDate = System.DateTime.Today;
            model.Direction     = "I";
            InventoryInDetailSessionWrapper.Initialize();

            return(View("CreateEdit", model));
        }
Пример #4
0
        public ActionResult Edit(long id)
        {
            var inventoryViewModel       = new CreateEditViewModel();
            var inventoryDetailViewModel = new List <InventoryDetailEntryViewModel>();
            var inventory = inventoryInProvider.GetInventory(id);

            if (inventory != null)
            {
                var inventoryDetail = inventoryInProvider.GetInventoryDetail(inventory.Id);
                if (inventoryDetail != null)
                {
                    mapper.Map(inventory, inventoryViewModel);
                    mapper.Map(inventoryDetail, inventoryDetailViewModel);
                    InventoryInDetailSessionWrapper.Initialize(inventoryDetailViewModel);
                    return(View("CreateEdit", inventoryViewModel));
                }
            }

            return(RedirectToAction("Index"));
        }
Пример #5
0
 public ActionResult CreateDetail(InventoryDetailEntryViewModel model, FormCollection form)
 {
     if (model.ProductId == 0)
     {
         var ajaxViewModel = new AjaxViewModel(isSuccess: false, data: null, message: "Please Choose Product!");
         return(Json(ajaxViewModel));
     }
     else if (model.Qty == 0)
     {
         var ajaxViewModel = new AjaxViewModel(isSuccess: false, data: null, message: "Please Fill Qty!");
         return(Json(ajaxViewModel));
     }
     else
     {
         // Get UOM
         model.UomId = inventoryInProvider.GetUOMId();
         InventoryInDetailSessionWrapper.AddDetail(model);
         //var summary = OrderDetailSessionWrapper.CalculateSummary();
         var ajaxViewModel = new AjaxViewModel(message: "Inventory detail has been added.");
         return(Json(ajaxViewModel));
     }
 }