Esempio n. 1
0
 public IActionResult UserPanel(UserPanelModel adminInput)
 {
     if (ModelState.IsValid)
     {
         if (adminInput.adminPassword == "123456")
         {
             return(RedirectToAction("AdminPanel", "Home"));
         }
     }
     return(Json("Wrong password!"));
 }
Esempio n. 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));
        }
Esempio n. 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"));
 }
Esempio n. 4
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);
 }