Пример #1
0
 private static void SetModelData(EmployeeModel model)
 {
     model.DeptList     = DeptDAO.QueryAll();
     model.EmployeeList = EmployeeDAO.QueryAll();
     model.EmpDeptList  = EmployeeDAO.QueryAllInfo();
     model.Datas        = EmployeeDAO.QueryAllDicInfo();
 }
Пример #2
0
 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));
 }
Пример #3
0
        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));
        }
Пример #4
0
        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));
        }
Пример #5
0
        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));
        }
Пример #6
0
 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));
     }
 }
Пример #7
0
 public ActionResult ToModify(EmployeeModel model)
 {
     model.Employee = EmployeeDAO.QueryByKey(model.Employee);
     model.DeptList = DeptDAO.QueryAll();
     return(View(model));
 }