示例#1
0
        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();
        }
示例#2
0
        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");
        }
示例#3
0
        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();
        }
示例#4
0
        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();
        }
示例#5
0
        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 });
            }
        }