示例#1
0
        //
        // GET: /User/Edit/5

        public ActionResult Edit(int id)
        {
            if (!AccessActions.IsAccess("User::Write"))
            {
                System.Web.Routing.RouteValueDictionary route = new System.Web.Routing.RouteValueDictionary();
                route.Add("err", "��� �������!");
                return(RedirectToAction("Error", "User", route));
            }
            UserModel    user   = new UserModel();
            RoleModel    role   = new RoleModel();
            BrancheModel branch = new BrancheModel();
            ActionModel  action = new ActionModel();
            TypeModel    type   = new TypeModel();

            //заполнение списка ролей
            ViewBag.Roles = role.FindAll();
            //Заполнение списка филиалов
            ViewBag.AllBranches  = branch.FindAll();
            ViewBag.UserBranches = branch.UserBranches(id);
            ViewBag.UserActions  = action.UserActions(id);
            ViewBag.AllActions   = action.FindAll();
            ViewBag.UserTypes    = type.UserTypes(id);
            ViewBag.AllTypes     = type.FindAll();
            user.FindByID(id);
            ViewBag.UsName = user.Name;
            return(View(user));
        }