public ActionResult EditShaveBeard(ShaveBeard model) { if (ModelState.IsValid) { unitOfWork.ShaveBeards.Edit(model); unitOfWork.Complete(); unitOfWork.Dispose(); return(RedirectToAction("Index", "ShaveBeard")); } else { return(View(model)); } }
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()); }