コード例 #1
0
 public IActionResult UserPanel(UserPanelModel adminInput)
 {
     if (ModelState.IsValid)
     {
         if (adminInput.adminPassword == "123456")
         {
             return(RedirectToAction("AdminPanel", "Home"));
         }
     }
     return(Json("Wrong password!"));
 }
コード例 #2
0
        public PartialViewResult UserPanel()
        {
            Store.SourceUrl = Request.RawUrl;
            var model = new UserPanelModel
            {
                Clients = AuthorizationRoot.Clients.Select(x => x.Name)
            };

            if (User.UserId != null && User.IsInRole("ADMIN"))
            {
                model.IncomesCount = DataService.GetUnprocessedIncomesCount();
            }
            return(PartialView(model));
        }
コード例 #3
0
 public ActionResult UserPanel()
 {
     if (Session["CurrentUser-Username"] != null)
     {
         var User  = repo.Get(Session["CurrentUser-Username"].ToString());
         var Model = new UserPanelModel()
         {
             NewComment = new Comment(),
             User       = User,
             UserEdit   = new UserEditViewModel()
             {
                 Gender       = User.Gender,
                 Name         = User.Name,
                 Surname      = User.Surname,
                 Screenname   = User.Screenname,
                 OriginalUser = User
             }
         };
         return(View("UserPanel", Model));
     }
     return(RedirectToAction("Index", "Home"));
 }
コード例 #4
0
ファイル: AccountController.cs プロジェクト: avgx/knigoskop
 public PartialViewResult UserPanel()
 {
     Store.SourceUrl = Request.RawUrl;
     var model = new UserPanelModel
     {
         Clients = AuthorizationRoot.Clients.Select(x => x.Name)
     };
     if (User.UserId != null && User.IsInRole("ADMIN"))
         model.IncomesCount = DataService.GetUnprocessedIncomesCount();
     return PartialView(model);
 }