public ActionResult UnregisterProduct(StoragePlaceProductVM model) { ViewBag.ProductId = new SelectList(productRepo.GetItems(), "Id", "Name"); if (!ModelState.IsValid) { return(View(model)); } if (!storageRepo.RemoveProduct(model.Id)) { return(View(model)); } return(RedirectToAction("Index")); }
public ActionResult AddProductToWareHouse(StoragePlaceProductVM model) { ViewBag.ProductId = new SelectList(productRepo.GetItems(), "Id", "Name"); if (!ModelState.IsValid) { return(View(model)); } if (!storageRepo.AddProduct(model.WarehouseId, model.ProductId, model.TotalAmount)) { return(View(model)); } return(RedirectToAction("Index")); }
public ActionResult UpdateStoragePlace(StoragePlaceProductVM model) { ViewBag.ProductId = new SelectList(productRepo.GetItems(), "Id", "Name"); if (!ModelState.IsValid) { return(View(model)); } if (!storageRepo.UpdateProduct(model.Id, model.ProductId, model.TotalAmount, model.ReservedAmount)) { return(View(model)); } return(RedirectToAction("Details", new { id = model.WarehouseId })); }