Example #1
0
 public ActionResult EditFaceCream(FaceCream model)
 {
     if (ModelState.IsValid)
     {
         unitOfWork.FaceCreams.Edit(model);
         unitOfWork.Complete();
         unitOfWork.Dispose();
         return(RedirectToAction("Index", "FaceCreams"));
     }
     else
     {
         return(View(model));
     }
 }
Example #2
0
 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());
 }