Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            SqlDataReader drProducts = DataProvider.GetProductList(Session["UserSystemId"].ToString());

            DropDownListProducts.DataValueField = "PRDCT_ID";
            DropDownListProducts.DataTextField  = "PRDCT_CODE-PRDCT_NAME";
            DropDownListProducts.DataSource     = drProducts;
            DropDownListProducts.DataBind();
            drProducts.Close();
        }
Example #2
0
    protected void LoadDropDownListProducts()
    {
        ProductsCS prod = new ProductsCS();

        DropDownListProducts.DataSource     = prod.GetProducts();
        DropDownListProducts.DataValueField = "ProductID";
        DropDownListProducts.DataTextField  = "ProductName";

        DropDownListProducts.DataBind();
    }
        private void GetProducts()
        {
            SqlDataReader drProducts = DataProvider.GetProductList(Session["UserSystemId"].ToString());

            DropDownListProducts.DataValueField = "PRDCT_ID";
            DropDownListProducts.DataTextField  = "PRDCT_CODE-PRDCT_NAME";
            DropDownListProducts.DataSource     = drProducts;
            DropDownListProducts.DataBind();
            drProducts.Close();

            if (Session["SelectedProduct"] != null)
            {
                DataController.SetAsSeletedValue(DropDownListProducts, Session["SelectedProduct"].ToString(), true);
            }
            else
            {
                if (DropDownListProducts.Items.Count > 0)
                {
                    Session["SelectedProduct"] = DropDownListProducts.Items[0].Value;
                }
            }
        }