public void OnGet() { VerifyLogin(); OrderData(); void VerifyLogin() { if (HttpContext.Session.GetInt32("Login") != null) { validUser = (int)HttpContext.Session.GetInt32("Login"); } else { validUser = 0; RedirectToPage("Login"); } if (HttpContext.Session.GetString("Email") != null) { email = HttpContext.Session.GetString("Email"); } else { email = null; RedirectToPage("Login"); } } void OrderData() { Orders = catalog.AllOrders(); } }
public IActionResult OnGet() { Orders = _oCatalog.AllOrders(); if (!String.IsNullOrEmpty(SearchFor)) { Orders = _oCatalog.Search(SearchFor); } return(Page()); }