Пример #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));
     }
 }
Пример #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());
 }