예제 #1
0
        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();
            }
        }
예제 #2
0
        public IActionResult OnGet()
        {
            Orders = _oCatalog.AllOrders();

            if (!String.IsNullOrEmpty(SearchFor))
            {
                Orders = _oCatalog.Search(SearchFor);
            }
            return(Page());
        }