Beispiel #1
0
 private void btn_Save_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         SaveInfo();
         bool wasSuccess = interaction.EditProduct(product);
         if (wasSuccess)
         {
             CreateMessage.ShowEditSuccesful("Product");
         }
         if (!wasSuccess)
         {
             CreateMessage.ShowFailureMessage();
         }
         NavigationService.Navigate(new ViewProductDetails(product.ProductID));
     }
     catch (Exception ex)
     {
         if (ex is FormatException)
         {
             CreateMessage.ShowInputNotValid();
         }
         ErrorHandler.Log.WriteFail(ex);
     }
 }
Beispiel #2
0
        public IActionResult EditProduct(ProductSpecificationViewModel viewModel, int productId)
        {
            var products = viewModel.Product;

            _productLogic.EditProduct(products);

            return(RedirectToAction("ProductManagment"));
        }
Beispiel #3
0
 public ActionResult Edit(ProductViewModel model)
 {
     if (ModelState.IsValid)
     {
         ProductLogic.EditProduct(model);
         return(Json(new { IsSucceeded = true }));
     }
     return(Json(new { IsSucceeded = false }));
 }
Beispiel #4
0
 public ActionResult ProductEdit([Bind(Include = "ProductId,Name,Description,Quantity,Price,Cost,PurchaseDate,SoldDate")] Product product)
 {
     if (ModelState.IsValid)
     {
         var productService = new ProductLogic();
         productService.EditProduct(product);
         return(RedirectToAction("Index"));
     }
     return(View(product));
 }
Beispiel #5
0
        public ActionResult Edit(ProductViewModel model)
        {
            ProductLogic.EditProduct(model);

            return(RedirectToAction("Index"));
        }