//
        // 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));
        }
        //
        // GET: /Abonents/Edit/5

        public ActionResult Edit(int id)
        {
            if (!AccessActions.IsAccess("Abonents::Write"))
            {
                System.Web.Routing.RouteValueDictionary route = new System.Web.Routing.RouteValueDictionary();
                route.Add("err", "Нет доступа!");
                return(RedirectToAction("Error", "User", route));
            }
            AbonentModel theAbonent = new AbonentModel();
            BrancheModel branch     = new BrancheModel();

            ViewBag.AllBranches = branch.FindAll();
            return(View(theAbonent.FindOne(id)));
        }
        // GET: /User/Create

        public ActionResult Create()
        {
            if (!AccessActions.IsAccess("User::Write"))
            {
                System.Web.Routing.RouteValueDictionary route = new System.Web.Routing.RouteValueDictionary();
                route.Add("err", "��� �������!");
                return(RedirectToAction("Error", "User", route));
            }
            RoleModel    role   = new RoleModel();
            BrancheModel branch = new BrancheModel();

            //заполнение списка ролей
            ViewBag.Roles = role.FindAll();
            //Заполнение списка филиалов
            ViewBag.Branches = branch.FindAll();
            return(View());
        }
Exemple #4
0
        //
        // GET: /Groups/Edit/5

        public PartialViewResult EditIndex(int GroupID)
        {
            if (!AccessActions.IsAccess("Groups::Write"))
            {
                System.Web.Routing.RouteValueDictionary route = new System.Web.Routing.RouteValueDictionary();
                ViewBag.Error = "Нет доступа!";
                return(PartialView("_Error"));
            }

            GroupModel Group = new GroupModel();

            Group = Group.FindOne(GroupID);

            ViewBag.GroupAbonents = Group.Abonents();
            ViewBag.AllAbonents   = Group.AbonentsAll();
            BrancheModel branch = new BrancheModel();

            ViewBag.AllBranches = branch.FindAll();
            return(PartialView("_AbonentsGroupEdit", Group));
        }