public ActionResult AddManager(ManagerModel manager) { List<string> _errList = new List<string>(); bool _success = false; if (ModelState.IsValid) { try { new ManagerRepository().Add(Mapper.Map<Manager>(manager)); _success = true; } catch (DalException e) { _errList.Add(e.Message); } catch (Exception) { _errList.Add("DataBase Error"); } } else { _errList = GetModelErrors(); } return Json(new { success = _success, error = _errList }); }
public ActionResult AddManager() { var manager = new ManagerModel(); return PartialView("AddManagerView", manager); }
public ActionResult DeleteManagerR(int id) { var manager = new ManagerModel() { Id = id }; return PartialView("DeleteManagerView", manager); }