public ActionResult EditFaceCream(FaceCream model) { if (ModelState.IsValid) { unitOfWork.FaceCreams.Edit(model); unitOfWork.Complete(); unitOfWork.Dispose(); return(RedirectToAction("Index", "FaceCreams")); } else { return(View(model)); } }
public ActionResult AddFaceCream(FaceCream model) { try { if (ModelState.IsValid) { unitOfWork.FaceCreams.Add(model); unitOfWork.Complete(); unitOfWork.Dispose(); return(RedirectToAction("Index", "FaceCreams")); } } catch (Exception ex) { //TODO: We want to show an error message return(View()); } return(View()); }