public ActionResult Edit(int id, StudentEntities.Entities.Product model) { try { var edited = _productComponent.EditProdcut(id, model); return(RedirectToAction(nameof(DisplayProducts), _productComponent.GetProducts())); } catch { return(View()); } }
public ActionResult Delete(int id, StudentEntities.Entities.Product model) { try { // TODO: Add delete logic here _productComponent.DeleteProduct(id); return(RedirectToAction(nameof(DisplayProducts), _productComponent.GetProducts())); } catch { return(View()); } }
public ActionResult Create(StudentEntities.Entities.Product model) { try { // TODO: Add insert logic here var added = _productComponent.AddProduct(model); return(RedirectToAction(nameof(DisplayProducts), _productComponent.GetProducts())); } catch (Exception e) { return(View()); } }