Exemplo n.º 1
0
        private void GetAndBindProducts(string category)
        {
            if (!string.IsNullOrEmpty(SearchTextBox.Text.Trim()))
            {
                this.search = SearchTextBox.Text.Trim();
            }

            if (string.IsNullOrEmpty(this.search))
            {
                l1 = ProductsDAO.GetPRODUCTsByCategory(category);
                ProductsListView.DataSource = l1;
                ProductsListView.DataBind();
            }
            else
            {
                l1 = ProductsDAO.GetPRODUCTsByCategorySearch(category, this.search.Trim());
                ProductsListView.DataSource = l1;
                ProductsListView.DataBind();
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (HttpContext.Current.Session == null || HttpContext.Current.Session["admin"] == null)
            {
                Response.Redirect("~/LoginP.aspx");
            }

            Page.Header.Title = "Fast food - Menu";


            if (IsPostBack == false)
            {
                SearchTextBox.Text   = "";
                this.category        = "Beverages";
                CategoryTextBox.Text = this.category;
                l1 = ProductsDAO.GetPRODUCTsByCategory(this.category);
                ProductsListView.DataSource = l1;
                ProductsListView.DataBind();
            }
        }