Пример #1
0
        private void PerformSearch(string databaseToSearch, string searchText)
        {
            //  if (databaseToSearch == "Products")
            if (databaseToSearch == "Students")
            {
                ErrorMessage.Text         = "";
                lstAllProducts.DataSource = GetProducts(searchText);
                if (lstAllProducts.Items.Count > 0)
                {
                    lstAllProducts.Visible = true;
                }
                lstAllProducts.DataBind();
            }

            else if (databaseToSearch == "Lecturers")
            {
                ErrorMessage.Text = "";

                ListAllLecturers.DataSource = GetLecturers(searchText);
                if (ListAllLecturers.Items.Count > 0)
                {
                    ListAllLecturers.Visible = true;
                }
                ListAllLecturers.DataBind();
            }
        }
Пример #2
0
        private void ResetProductView()
        {
            lstAllProducts.EditIndex  = -1;
            lstAllProducts.DataSource = GetProducts("");
            lstAllProducts.DataBind();

            ListAllLecturers.EditIndex  = -1;
            ListAllLecturers.DataSource = GetProducts("");
            ListAllLecturers.DataBind();
        }