private static void SetModelData(EmployeeModel model) { model.DeptList = DeptDAO.QueryAll(); model.EmployeeList = EmployeeDAO.QueryAll(); model.EmpDeptList = EmployeeDAO.QueryAllInfo(); model.Datas = EmployeeDAO.QueryAllDicInfo(); }
public ActionResult Modify(EmployeeModel model) { try { EmployeeDAO.Modify(model.Employee); model.Message = "修改员工信息成功."; } catch (Exception ex) { model.Message = ex.Message; } model.DeptList = DeptDAO.QueryAll(); return(View("ToModify", model)); }
public ActionResult Delete(DeptModel model) { try { DeptDAO.Delete(model.Dept.DeptId); model.Message = "删除部门信息成功"; } catch (Exception ex) { model.Message = ex.Message; } model.DeptList = DeptDAO.QueryAll(); return(View("Index", model)); }
public ActionResult Add(DeptModel model) { try { DeptDAO.Add(model.Dept); model.Message = "保存部门信息成功"; } catch (Exception ex) { model.Message = ex.Message; } model.DeptList = DeptDAO.QueryAll(); return(View("Index", model)); }
public ActionResult Index() { DeptModel model = new DeptModel(); try { model.DeptList = DeptDAO.QueryAll(); } catch (Exception ex) { model.DeptList = new List <TblDept>(); model.Message = ex.Message; } return(View(model)); }
public ActionResult ToModify(DeptModel model) { try { model.Dept = DeptDAO.QueryByKey(model.Dept); if (model.Dept == null) { model.Message = "修改的数据不存在。"; model.DeptList = DeptDAO.QueryAll(); return(View("Index", model)); } return(View(model)); } catch (Exception ex) { model.Message = ex.Message; model.DeptList = DeptDAO.QueryAll(); return(View("Index", model)); } }
public ActionResult ToModify(EmployeeModel model) { model.Employee = EmployeeDAO.QueryByKey(model.Employee); model.DeptList = DeptDAO.QueryAll(); return(View(model)); }