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); } }
public IActionResult EditProduct(ProductSpecificationViewModel viewModel, int productId) { var products = viewModel.Product; _productLogic.EditProduct(products); return(RedirectToAction("ProductManagment")); }
public ActionResult Edit(ProductViewModel model) { if (ModelState.IsValid) { ProductLogic.EditProduct(model); return(Json(new { IsSucceeded = true })); } return(Json(new { IsSucceeded = false })); }
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)); }
public ActionResult Edit(ProductViewModel model) { ProductLogic.EditProduct(model); return(RedirectToAction("Index")); }