protected void FillDropDownList()
        {
            DropDownCategoryList.DataSource     = itemManger.GetAllCategory();
            DropDownCategoryList.DataTextField  = "CategoryName";
            DropDownCategoryList.DataValueField = "CategoryID";
            DropDownCategoryList.DataBind();
            DropDownCategoryList.Items.Insert(0, new ListItem("Select", "0"));

            DropDownCompanyList.DataSource     = itemManger.GetAllCompany();
            DropDownCompanyList.DataTextField  = "CompanyName";
            DropDownCompanyList.DataValueField = "CompanyID";
            DropDownCompanyList.DataBind();
            DropDownCompanyList.Items.Insert(0, new ListItem("Select", "0"));
        }
        protected void FillDropDownList()
        {
            CompanyManger company = new CompanyManger();

            DropDownCompanyList.DataSource     = company.GetAllCompany();
            DropDownCompanyList.DataTextField  = "CompanyName";
            DropDownCompanyList.DataValueField = "CompanyID";
            DropDownCompanyList.DataBind();
            DropDownCompanyList.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Select", "0"));

            ItemManager itemManager = new ItemManager();

            DropDownCategoryList.DataSource     = itemManager.GetAllCategory();
            DropDownCategoryList.DataTextField  = "CategoryName";
            DropDownCategoryList.DataValueField = "CategoryID";
            DropDownCategoryList.DataBind();
            DropDownCategoryList.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Select", "0"));
        }
 protected void DropDownCompanySelectedIndexChange(object sender, EventArgs e)
 {
     if (DropDownCompanyList.SelectedIndex != 0)
     {
         ItemManager itemManager = new ItemManager();
         int         companyId   = Convert.ToInt32(DropDownCompanyList.SelectedItem.Value);
         DropDownCategoryList.DataSource     = itemManager.GetCategoryByCompanyID(companyId);
         DropDownCategoryList.DataTextField  = "CategoryName";
         DropDownCategoryList.DataValueField = "CategoryID";
         DropDownCategoryList.DataBind();
         DropDownCategoryList.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Select", "0"));
     }
     else
     {
         ItemManager itemManager = new ItemManager();
         DropDownCategoryList.DataSource     = itemManager.GetAllCategory();
         DropDownCategoryList.DataTextField  = "CategoryName";
         DropDownCategoryList.DataValueField = "CategoryID";
         DropDownCategoryList.DataBind();
         DropDownCategoryList.Items.Insert(0, new System.Web.UI.WebControls.ListItem("Select", "0"));
     }
 }