Ejemplo n.º 1
0
 public ActionResult EditShaveBeard(ShaveBeard model)
 {
     if (ModelState.IsValid)
     {
         unitOfWork.ShaveBeards.Edit(model);
         unitOfWork.Complete();
         unitOfWork.Dispose();
         return(RedirectToAction("Index", "ShaveBeard"));
     }
     else
     {
         return(View(model));
     }
 }
Ejemplo n.º 2
0
 public ActionResult AddShaveBeard(ShaveBeard model)
 {
     try
     {
         if (ModelState.IsValid)
         {
             unitOfWork.ShaveBeards.Add(model);
             unitOfWork.Complete();
             unitOfWork.Dispose();
             return(RedirectToAction("Index", "ShaveBeard"));
         }
     }
     catch (Exception ex)
     {
         return(View());
     }
     return(View());
 }