public ActionResult UserEdit(string id = null) { SystemConfigureLib.UserController userController = new SystemConfigureLib.UserController(); SystemConfigureLib.UserTypeController userTypeController = new SystemConfigureLib.UserTypeController(); SystemConfigureLib.DeptController deptController = new SystemConfigureLib.DeptController(); this.init(); if (id == null) { ViewData["title"] = "新增管理员"; } else { System.Collections.Hashtable user = userController.load(id); if (user != null) { ViewData["user"] = user; } ViewData["title"] = "编辑管理员"; } ViewData["open_menu"] = "系统管理"; List<System.Collections.Hashtable> depts = deptController.getAll(); ViewData["depts"] = depts; List<System.Collections.Hashtable> userType = userTypeController.getAll(); ViewData["user_type"] = userType; return View(); }
public ActionResult DeptSave() { SystemConfigureLib.DeptController deptController = new SystemConfigureLib.DeptController(); DatabaseLib.Tools tools = new DatabaseLib.Tools(); string strParam = Request.Form.ToString(); System.Collections.Hashtable data = tools.paramToData(strParam); string dept_id = CommonLib.Common.Validate.IsNullString(Request.Params["DeptID"]); if (dept_id == "") { dept_id = deptController.add(data); if (dept_id == null) { return RedirectToRoute("dept-add"); } } else { deptController.save(data); } return RedirectToRoute("dept-add"); }
public ActionResult DeptEdit(string id = null) { SystemConfigureLib.DeptController deptController = new SystemConfigureLib.DeptController(); this.init(); if (id == null) { ViewData["title"] = "新增部门"; } else { System.Collections.Hashtable dept = deptController.load(id); if (dept != null) { ViewData["dept"] = dept; } ViewData["title"] = "编辑部门"; } ViewData["open_menu"] = "系统管理"; return View(); }
public ActionResult DeptList(int page = 1) { this.init(); SystemConfigureLib.DeptController deptController = new SystemConfigureLib.DeptController(); List<System.Collections.Hashtable> list = deptController.getAll(); ViewData["depts"] = list; ViewData["open_menu"] = "系统管理"; return View(); }
public ActionResult DeptDelete(string id = null, int page = 1) { SystemConfigureLib.DeptController deptController = new SystemConfigureLib.DeptController(); this.init(); if (id == null) { return RedirectToRoute("dept-list-home"); } else { deptController.delete(id); return RedirectToRoute("dept-list", new { page = page }); } }