コード例 #1
0
 public ActionResult EditSetting(SiteAttribute attr)
 {
     this.serviceFactory.SiteService.Update(attr);
     return(RedirectToAction(ControllerNaming.Action <AdminSettingsController>(x => x.EditSetting(attr.Id)),
                             ControllerNaming.Name <AdminSettingsController>(),
                             new { id = attr.Id }));
 }
コード例 #2
0
        public ActionResult EditUser(User user, FormCollection forms)
        {
            user.Password = forms.Get("Password");

            this.serviceFactory.UserService.Update(user);
            return(RedirectToAction(ControllerNaming.Action <AdminUserController>(x => x.EditUser(user.Id)),
                                    ControllerNaming.Name <AdminUserController>(),
                                    new { id = user.Id }));
        }
コード例 #3
0
        public ActionResult LogOff()
        {
            FormsAuthentication.SignOut();

            return(RedirectToAction(ControllerNaming.Action <HomeController>(x => x.Default()), ControllerNaming.Name <HomeController>()));
        }
コード例 #4
0
        public ActionResult LogOn(string userName, string password, bool rememberMe, string returnUrl)
        {
            if (!this.ValidateLogOn(userName, password))
            {
                return(View());
            }

            FormsAuthentication.SetAuthCookie(userName, rememberMe);
            if (!String.IsNullOrEmpty(returnUrl))
            {
                return(Redirect(returnUrl));
            }

            return(RedirectToAction(ControllerNaming.Action <AdminController>(x => x.Dashboard()), ControllerNaming.Name <AdminController>()));
        }