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