public async Task <IActionResult> OnPostSearch(string Search) { string ulogvanUser = signInManager.UserManager.GetUserId(User); if (Search != null) { Stripovi = await stripRepository.Search(Search, ulogvanUser); brojStripovauProdaji = Stripovi.Count(); return(Page()); } Stripovi = await stripRepository.UserStripoviVanKorpe(ulogvanUser); brojStripovauProdaji = Stripovi.Count(); return(Page()); }
public async Task <IActionResult> OnGetAsync() { if (signInManager.IsSignedIn(User)) { if (User.IsInRole("SuperAdmin")) { return(RedirectToPage("Administrator")); } var ulogvanUser = signInManager.UserManager.GetUserId(User); Stripovi = await stripRepository.UserStripoviVanKorpe(ulogvanUser); } else { Stripovi = await stripRepository.GetStripove(); } brojStripovauProdaji = Stripovi.Count(); return(Page()); }