protected void LoadCompanies()
    {
        connectionstring concls = new connectionstring();
        ylibWebClass ylib = new ylibWebClass(concls.connect());
        FillWebControlClass FCC = new FillWebControlClass();

        FCC.FillDropDownList(ref ddlCompany, ylib.GiveDataTable_BySQLStatement("select CompanyId,CompanyName from Company"), "CompanyName", "CompanyId", true, false, "");
    }
    private void BindData()
    {
        FillWebControlClass FCC = new FillWebControlClass();

        int ProductId; int DocumentId; int LanguageId; int OSId; int OSDocumenType;

        #region SetListVariables

        ProductId = StringOperation.QueryStringInt16Value(Request.QueryString["ProductId"]);
        DocumentId = StringOperation.QueryStringInt16Value(Request.QueryString["DocumentId"]);
        LanguageId = StringOperation.QueryStringInt16Value(Request.QueryString["LanguageId"]);

        OSDocumenType = StringOperation.QueryStringInt16Value(Request.QueryString["OSDocumenType"]);
        OSId = StringOperation.QueryStringInt16Value(Request.QueryString["OSId"]);

        if (OSDocumenType == 0)
        {
            lblDocumentype.Text = "Documents ";
            DocDriverType.Text = "(PDF,DOC,DOCX,XLS,XLSX,TXT)";
            RegularExpressionValidator1.ErrorMessage = "You must select a .pdf, .doc,.docx, .xls,.xlsx file to upload.";
            RegularExpressionValidator1.ValidationExpression = "^.+\\.((doc)|(DOC)|(docx)|(DOCX)|(pdf)|(PDF)|(xls)|(XLS)(xlsx)|(XLSX)|(TXT)|(txt))$";

        }
        else if (OSDocumenType == 1)
        {
            lblDocumentype.Text = "Drivers ";
            DocDriverType.Text = "(EXE,RAR)";
            RegularExpressionValidator1.ErrorMessage = "You must select a .exe, .rar file to upload.";
            RegularExpressionValidator1.ValidationExpression = "^.+\\.((exe)|(EXE)|(rar)|(RAR))$";
        }

        #endregion

        #region FillDropDownLists

        dtDocuments = taDocuments.GetData();
        FCC.FillDropDownList(ref ddlBrochureName, dtDocuments, "DocumentName", "DocumentId", true, true, DocumentId.ToString());

        dtLanguages = taLanguages.GetData();
        FCC.FillDropDownList(ref ddlLanguage, dtLanguages, "LanguageName", "LanguageId", true, true, LanguageId.ToString());

        dtOperatingSystem = taOperatingSystem.GetDataByDocumenType(Convert.ToInt16(OSDocumenType));
        FCC.FillDropDownList(ref ddlOS, dtOperatingSystem, "OSDescription", "OSId",true,true, OSId.ToString());

        #endregion
    }
    private void BindData()
    {
        DataTable DT;
        ylib = new ylibWebClass(constr.connect());

        FillWebControlClass FCC = new FillWebControlClass();

        int CompanyId; int SubCategoryId; int CategoryId; int ProductGroupCode;

        #region SetListVariables

        CompanyId = StringOperation.QueryStringInt16Value(Request.QueryString["CompanyId"]);
        CategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["CategoryId"]);
        SubCategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["SubCategoryId"]);
        ProductGroupCode = StringOperation.QueryStringInt16Value(Request.QueryString["ProductGroupCode"]);

        #endregion

        #region FillDropDownLists

        dtCompany = taCompany.GetData();
        FCC.FillDropDownList(ref ddlCompany, dtCompany, "CompanyName", "CompanyId", true, true, CompanyId.ToString());

        dtCategory = taCategory.SelectCategorybyCompanyId(CompanyId);
        FCC.FillDropDownList(ref ddlCategory, dtCategory, "CategoryName", "CategoryId", true, true, CategoryId.ToString());

        dtSubCategory = taSubCategory.GetDataByCategoryId(CategoryId);
        FCC.FillDropDownList(ref ddlSubCategory, dtSubCategory, "SubCategoryName", "SubCategoryId", true, true, SubCategoryId.ToString());

        dtProductGroup = taProductGroup.GetDataBySubCategoryId(SubCategoryId);
        FCC.FillDropDownList(ref ddlProductGroupCode, dtProductGroup, "ProductGroupDescription", "ProductGroupCode", true, true, ProductGroupCode.ToString());

        #endregion

        #region SetSelectionLabel

        if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0 && ProductGroupCode != 0)
            lblGroupLevel.Text = "Product Group";
        else if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0)
            lblGroupLevel.Text = "Sub Category";
        else if (CompanyId != 0 && CategoryId != 0)
            lblGroupLevel.Text = "Category";
        else if (CompanyId != 0)
            lblGroupLevel.Text = "Company";

        #endregion

        #region Set Main Repeater Page Parts

        DT = ylib.GiveDataTable_BySQLStatement("select PagePartName from PageParts ");

        if (DT.Rows.Count > 0)
        {
            if (CompanyId != 0)
            {
                Repeater1.DataSource = DT;
                Repeater1.DataBind();
            }

        }
        else
        {
            lblMsg.Text = "No record found";
            return;
        }

        #endregion
    }
    private void BindData()
    {
        int SectionCode = 0;
        FillWebControlClass FCC = new FillWebControlClass();

        ylib = new ClassP.ylibWebClass(constr.connect());

        lblGroupLevel.Text = Request.QueryString["lblGroupLevel"];

        int CompanyId ;        int SubCategoryId ;        int CategoryId;        int ProductGroupCode ;

        #region SetListVariables

        SectionCode = StringOperation.QueryStringInt16Value(Request.QueryString["SectionCode"]);
        CompanyId = StringOperation.QueryStringInt16Value(Request.QueryString["CompanyId"]);
        CategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["CategoryId"]);
        SubCategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["SubCategoryId"]);
        ProductGroupCode = StringOperation.QueryStringInt16Value(Request.QueryString["ProductGroupCode"]);

        #region Write Cookies

        if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0 && ProductGroupCode != 0)
        {
            Response.Cookies["ProductGroupCode"].Value=ProductGroupCode.ToString();
            Response.Cookies["ProductGroupCode"].Expires=DateTime.Now.AddDays(1);
        }
        else if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0)
        {
            Response.Cookies["SubCategoryId"].Value=SubCategoryId.ToString();
            Response.Cookies["SubCategoryId"].Expires=DateTime.Now.AddDays(1);
        }
        else if (CompanyId != 0 && CategoryId != 0)
        {
            Response.Cookies["CategoryId"].Value = CategoryId.ToString();
            Response.Cookies["CategoryId"].Expires = DateTime.Now.AddDays(1);
        }
        else if (CompanyId != 0)
        {
            Response.Cookies["CompanyId"].Value = CompanyId.ToString();
            Response.Cookies["CompanyId"].Expires = DateTime.Now.AddDays(1);
        }

        #endregion

        #endregion

        lblSectionName.Text = ylib.giveValue("select SectionName from   MainPageSection where SectionCode=" + SectionCode);

        #region FillDropDownLists

        dtCompany = taCompany.GetData();
        FCC.FillDropDownList(ref ddlCompany, dtCompany, "CompanyName", "CompanyId",true,true,CompanyId.ToString());

        dtCategory = taCategory.SelectCategorybyCompanyId(CompanyId);
        FCC.FillDropDownList(ref ddlCategory, dtCategory, "CategoryName", "CategoryId", true, true, CategoryId.ToString());

        dtSubCategory = taSubCategory.GetDataByCategoryId(CategoryId);
        FCC.FillDropDownList(ref ddlSubCategory, dtSubCategory, "SubCategoryName", "SubCategoryId", true, true, SubCategoryId.ToString());

        dtProductGroup = taProductGroup.GetDataBySubCategoryId(SubCategoryId);
        FCC.FillDropDownList(ref ddlProductGroupCode, dtProductGroup, "ProductGroupDescription", "ProductGroupCode", true, true, ProductGroupCode.ToString());

        #endregion

        if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0 && ProductGroupCode!=0)
            dtProduct = taProduct.GetDataByProductGroupCode(ProductGroupCode);
        else
            dtProduct = taProduct.GetDataByProductGroupCode(0);

        if (dtProduct.Rows.Count > 0)
        {
            GridView1.DataSourceID = null;
            GridView1.DataSource = dtProduct;
            GridView1.DataBind();
        }
        else
        {
            GridView1.DataSourceID = null;
            GridView1.DataSource = dtProduct;
            GridView1.DataBind();
            lblMsg.Text = "No record found";
            return;
        }
    }
    private void BindData()
    {
        FillWebControlClass FCC = new FillWebControlClass();

        int CompanyId ;        int SubCategoryId ;        int CategoryId;        int ProductGroupCode ;

        #region SetListVariables

        CompanyId = StringOperation.QueryStringInt16Value(Request.QueryString["CompanyId"]);
        CategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["CategoryId"]);
        SubCategoryId = StringOperation.QueryStringInt16Value(Request.QueryString["SubCategoryId"]);
        ProductGroupCode = StringOperation.QueryStringInt16Value(Request.QueryString["ProductGroupCode"]);

        #region Write Cookies

        if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0 && ProductGroupCode != 0)
        {
            Response.Cookies["ProductGroupCode"].Value = ProductGroupCode.ToString();
            Response.Cookies["ProductGroupCode"].Expires = DateTime.Now.AddDays(1);
        }
        else if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0)
        {
            Response.Cookies["SubCategoryId"].Value = SubCategoryId.ToString();
            Response.Cookies["SubCategoryId"].Expires = DateTime.Now.AddDays(1);
        }
        else if (CompanyId != 0 && CategoryId != 0)
        {
            Response.Cookies["CategoryId"].Value = CategoryId.ToString();
            Response.Cookies["CategoryId"].Expires = DateTime.Now.AddDays(1);
        }
        else if (CompanyId != 0)
        {
            Response.Cookies["CompanyId"].Value = CompanyId.ToString();
            Response.Cookies["CompanyId"].Expires = DateTime.Now.AddDays(1);
        }

        #region GetCookies

        if (Request.Cookies["CompanyId"] != null && CompanyId==0)
            CompanyId = StringOperation.QueryStringInt16Value(Convert.ToString(Request.Cookies["CompanyId"].Value));
        if (Request.Cookies["CompanyId"] != null && Request.Cookies["CategoryId"] != null && CategoryId == 0)
            CategoryId = StringOperation.QueryStringInt16Value(Convert.ToString(Request.Cookies["CategoryId"].Value));
        if (Request.Cookies["CompanyId"] != null && Request.Cookies["CategoryId"] != null && Request.Cookies["SubCategoryId"] != null && SubCategoryId == 0)
            SubCategoryId = StringOperation.QueryStringInt16Value(Convert.ToString(Request.Cookies["SubCategoryId"].Value));
        //if (Request.Cookies["ProductGroupCode"] != null && ProductGroupCode == 0)
        //    ProductGroupCode = StringOperation.QueryStringInt16Value(Convert.ToString(Request.Cookies["ProductGroupCode"].Value));

        #endregion

        #endregion

        #endregion

        #region FillDropDownLists

        dtCompany = taCompany.GetData();
        FCC.FillDropDownList(ref ddlCompany, dtCompany, "CompanyName", "CompanyId",true,true,CompanyId.ToString());

        dtCategory = taCategory.SelectCategorybyCompanyId(CompanyId);
        FCC.FillDropDownList(ref ddlCategory, dtCategory, "CategoryName", "CategoryId", true, true, CategoryId.ToString());

        dtSubCategory = taSubCategory.GetDataByCategoryId(CategoryId);
        FCC.FillDropDownList(ref ddlSubCategory, dtSubCategory, "SubCategoryName", "SubCategoryId", true, true, SubCategoryId.ToString());

        dtProductGroup = taProductGroup.GetDataBySubCategoryId(SubCategoryId);
        FCC.FillDropDownList(ref ddlProductGroupCode, dtProductGroup, "ProductGroupDescription", "ProductGroupCode", true, true, ProductGroupCode.ToString());

        #endregion

        if (CompanyId != 0 && CategoryId != 0 && SubCategoryId != 0 && ProductGroupCode!=0)
            dtProduct = taProduct.GetDataByProductGroupCode(ProductGroupCode);
        else
            dtProduct = taProduct.GetDataByProductGroupCode(0);

        if (dtProduct.Rows.Count > 0)
        {
            GridView1.DataSourceID = null;
            GridView1.DataSource = dtProduct;
            GridView1.DataBind();
        }
        else
        {
            GridView1.DataSourceID = null;
            GridView1.DataSource = dtProduct;
            GridView1.DataBind();
            lblMsg.Text = "No record found";
            return;
        }
    }
    private void LoadDropDownLists()
    {
        FillWebControlClass FCC = new FillWebControlClass();

        //drop down filling through method 1
        dtBas_Brands=dsBas_Brands.GetData();
        FCC.FillDropDownList(ref ddlBas_Brands, dtBas_Brands, "Br_Name", "Br_Code");

        //drop down filling through method 2
        connectionstring concls = new connectionstring();
        ylibWebClass ylib = new ylibWebClass(concls.connect());
        FCC.FillDropDownList(ref ddlBas_Warranties,ylib.GiveDataTable_BySQLStatement("select WarCode,WatName from Bas_Warranties"), "WatName", "WarCode");
    }