protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["subcat"] == "Circulars/Instructions")
            {
                category = Request.QueryString["cat"].Replace("/", " ");
                subcategory = Request.QueryString["subcat"];
            }
            else if (Request.QueryString["subcat"] == "Case/Laws")
            {
                category = Request.QueryString["cat"].Replace("/", " ");
                subcategory = Request.QueryString["subcat"].Replace("/", " ");
                lblAgreements.Text = category + " " + subcategory;
            }

            else
            {
                category = Request.QueryString["cat"].Replace("/", " ");
                subcategory = Request.QueryString["subcat"].Replace("/", " ");
            }

            #region Circulars/Instructions
            if (subcategory == "Circulars/Instructions" & category != "")
            {
                group = subcategory.Split('/');

                if (group[0].Equals("Circulars"))
                {
                    Circulars_Index_selectTableAdapter circularIndex = new Circulars_Index_selectTableAdapter();
                    DataTable dtcircularsIndex = circularIndex.Circulars_Index(category);
                    if (dtcircularsIndex.Rows.Count > 0)
                    {
                        dlIndexCirculars.DataSource = dtcircularsIndex;
                        dlIndexCirculars.DataBind();
                    }

                    if (group[1].Equals("Instructions"))
                    {
                        Instructors_Index_selectTableAdapter instructorsIndex = new Instructors_Index_selectTableAdapter();
                        DataTable dtinstructorsIndex = instructorsIndex.Instructors_Index(category);
                        if (dtinstructorsIndex.Rows.Count > 0)
                        {
                            dlIndexInstrcutions.DataSource = dtinstructorsIndex;
                            dlIndexInstrcutions.DataBind();
                        }
                    }
                }
                InvisibleRuleLabels();
                InvisibleFormLabels();
                dlIndex.Visible = true;
                //invisible rules
                dlAgreements.Visible = false;
                dlBaggage.Visible = false;
                dlCustomDrawBack.Visible = false;
                dlCustomValuation.Visible = false;
                dlOthers.Visible = false;
                //invisible forms
                dlRefunds.Visible = false;
                dlAppeals.Visible = false;
                dlDrawback.Visible = false;
                dlOthersApplicationForms.Visible = false;
                dlShipping.Visible = false;
                dllBill.Visible = false;
                dlBonds.Visible = false;
                dlSettlementCommission.Visible = false;
                dlSTCaseLaws.Visible = false;
                dlDGFT.Visible = false;

                //invisible SEZ
                gvSEZ.Visible = false;
                //invisible ServiceTax
                gvservicetaxforms.Visible = false;
                gvstacts.Visible = false;
                gvstrules.Visible = false;
                dtstaccodes.Visible = false;
                dlITActs.Visible = false;
                pnlITActsGift.Visible = false;
                pnlITActsInterest.Visible = false;
                dlantidumpingduty.Visible = false;
                pnlSION.Visible = false;
                //visible Circular/Instruction Headings
                if (category == "DGFT")
                {
                    lblInstructionHeading.Visible = false;

                }
                else
                {
                    lblInstructionHeading.Visible = true;
                }

                lblCircularHeading.Visible = true;

                pnlSTlibraries.Visible = false;
                pnlSTTaxation.Visible = false;
                pnlCEManual.Visible = false;
                dltariff.Visible = false;
                dlnontariff.Visible = false;
                dlsafeguards.Visible = false;
                dlCECothers.Visible = false;
                dlSTN.Visible = false;

            }
            #endregion
            else
            {
                if (category == "Customs")
                {
                    #region CustomsIndex

                    if (category == "Customs" & subcategory == "Rules")
                    {
                        VisibleRuleLabels();
                        InvisibleFormLabels();
                        dlIndex.Visible = false;
                        //visible rules
                        dlAgreements.Visible = true;
                        dlBaggage.Visible = true;
                        dlCustomDrawBack.Visible = true;
                        dlCustomValuation.Visible = true;
                        dlOthers.Visible = true;
                        //invisible froms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlDGFT.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //invisible SEZ
                        gvSEZ.Visible = false;
                        //invisible ServiceTax
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        pnlSION.Visible = false;
                        lblAgreements.Text = "Agreements between nations";
                        lblBaggage.Text = "Baggage Rules, 1998";

                        ActsTableAdapter indexByHeadings = new ActsTableAdapter();
                        DataTable dtAgreements = indexByHeadings.GetIndexbyRulesHeadings(subcategory, "Agreements between nations");
                        dlAgreements.DataSource = dtAgreements;
                        dlAgreements.DataBind();

                        DataTable dtBaggage = indexByHeadings.GetIndexbyRulesHeadings(subcategory, "Baggage Rules, 1998");
                        dlBaggage.DataSource = dtBaggage;
                        dlBaggage.DataBind();

                        DataTable dtCustomDrawBack = indexByHeadings.GetIndexbyRulesHeadings(subcategory, "Customs Drawback Rules");
                        dlCustomDrawBack.DataSource = dtCustomDrawBack;
                        dlCustomDrawBack.DataBind();

                        DataTable dtCustomValuation = indexByHeadings.GetIndexbyRulesHeadings(subcategory, "Customs Valuation Rules");
                        dlCustomValuation.DataSource = dtCustomValuation;
                        dlCustomValuation.DataBind();

                        DataTable dtOthers = indexByHeadings.GetIndexbyRulesHeadings(subcategory, "Others");
                        dlOthers.DataSource = dtOthers;
                        dlOthers.DataBind();
                    }
                    else if (category == "Customs" & subcategory == "Forms")
                    {
                        InvisibleRuleLabels();
                        VisibleFormLabels();
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //visible froms
                        dlRefunds.Visible = true;
                        dlAppeals.Visible = true;
                        dlDrawback.Visible = true;
                        dlOthersApplicationForms.Visible = true;
                        dlShipping.Visible = true;
                        dllBill.Visible = true;
                        dlBonds.Visible = true;
                        dlDGFT.Visible = false;
                        dlSettlementCommission.Visible = true;
                        dlSTCaseLaws.Visible = false;
                        //invisible SEZ
                        gvSEZ.Visible = false;
                        //invisible ServiceTax Data
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        pnlSION.Visible = false;
                        ActsTableAdapter indexByHeadings = new ActsTableAdapter();

                        DataTable dtRefunds = indexByHeadings.GetIndexbyFormsHeadings(subcategory, "Application Forms", "Refunds");
                        dlRefunds.DataSource = dtRefunds;
                        dlRefunds.DataBind();

                        DataTable dtAppeals = indexByHeadings.GetIndexbyFormsHeadings(subcategory, "Application Forms", "Appeals");
                        dlAppeals.DataSource = dtAppeals;
                        dlAppeals.DataBind();

                        DataTable dtDrawback = indexByHeadings.GetIndexbyFormsHeadings(subcategory, "Application Forms", "Drawback");
                        dlDrawback.DataSource = dtDrawback;
                        dlDrawback.DataBind();

                        DataTable dtOthersApplicationForms = indexByHeadings.GetIndexbyFormsHeadings(subcategory, "Application Forms", "Others");
                        dlOthersApplicationForms.DataSource = dtOthersApplicationForms;
                        dlOthersApplicationForms.DataBind();

                        DataTable dtShipping = indexByHeadings.GetIndexbyFormsHeadings(subcategory, "Shipping Bill Forms", "");
                        dlShipping.DataSource = dtShipping;
                        dlShipping.DataBind();

                        DataTable dtBill = indexByHeadings.GetIndexbyFormsHeadings(subcategory, "Bill of Entry Forms", "");
                        dllBill.DataSource = dtBill;
                        dllBill.DataBind();

                        DataTable dtBonds = indexByHeadings.GetIndexbyFormsHeadings(subcategory, "Bonds", "");
                        dlBonds.DataSource = dtBonds;
                        dlBonds.DataBind();

                        DataTable dtSettlementCommission = indexByHeadings.GetIndexbyFormsHeadings(subcategory, "Settlement Commission", "");
                        dlSettlementCommission.DataSource = dtSettlementCommission;
                        dlSettlementCommission.DataBind();
                    }
                    else if (category == "Customs" & subcategory == "SEZ")
                    {
                        InvisibleRuleLabels();
                        InvisibleFormLabels();
                        //invisible all
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //invisible forms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlDGFT.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //visible SEZ
                        gvSEZ.Visible = true;
                        //invisible ServiceTax Data
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        pnlSION.Visible = false;
                        ActsTableAdapter index = new ActsTableAdapter();
                        DataTable dtSEZ = index.SEZ_Index(subcategory);
                        gvSEZ.DataSource = dtSEZ;
                        gvSEZ.DataBind();
                    }
                    else if (category == "Customs" & subcategory == "Tariff 2012-13")
                    {
                        InvisibleRuleLabels();
                        InvisibleFormLabels();
                        //invisible all
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //invisible forms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        dlDGFT.Visible = false;
                        //visible SEZ
                        gvSEZ.Visible = true;
                        //invisible ServiceTax Data
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlCEManual.Visible = false;
                        pnlSTTaxation.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        pnlSION.Visible = false;
                        DataTable dtGroups = new DataTable();
                        DataRow row = null;

                        DataColumn dcRelationShip = new DataColumn("Group");
                        dcRelationShip.DataType = System.Type.GetType("System.String");
                        dtGroups.Columns.Add(dcRelationShip);
                        row = dtGroups.NewRow();
                        row["Group"] = "General Notes";
                        dtGroups.Rows.Add(row);
                        row = dtGroups.NewRow();
                        row["Group"] = "Import Tariff";
                        dtGroups.Rows.Add(row);
                        row = dtGroups.NewRow();
                        row["Group"] = "General Exemptions";
                        dtGroups.Rows.Add(row);
                        row = dtGroups.NewRow();
                        row["Group"] = "The Second Schedule Export Tariff";
                        dtGroups.Rows.Add(row);
                        row = dtGroups.NewRow();
                        row["Group"] = "Anti Dumping Duty Notifications";
                        dtGroups.Rows.Add(row);
                        row = dtGroups.NewRow();
                        row["Group"] = "Appendix";
                        dtGroups.Rows.Add(row);
                        string redirect = string.Empty;
                        Custom_Tariff_IndexnameTableAdapter index = new Custom_Tariff_IndexnameTableAdapter();

                        ltlIndex.Text = "<table>";
                        foreach (DataRow drGroups in dtGroups.Rows)
                        {
                            string groupName = drGroups[0].ToString();
                            DataTable dtIndex = index.Custom_Tariff_IndexbyGroup(groupName);

                            if (dtIndex.Rows.Count > 0)
                            {
                                string name = string.Empty;
                                string _indexName = string.Empty;
                                foreach (DataRow drIndex in dtIndex.Rows)
                                {
                                    bool isDoc = false;
                                    string indexname = drIndex["indexname"].ToString();
                                    DataTable dtChapterbyIndex = index.GetCustomTariffByIndex(indexname);
                                    if (dtChapterbyIndex.Rows.Count > 0)
                                    {
                                        string aChapter = Convert.ToString(dtChapterbyIndex.Rows[0]["chaptername"]);
                                        if (aChapter.Equals(""))
                                        {
                                            string adata = Convert.ToString(dtChapterbyIndex.Rows[0]["data"]);
                                            isDoc = adata.Equals("");
                                            redirect = "shownotifications.aspx";
                                        }
                                        else
                                        {
                                            redirect = "displayindex.aspx";
                                        }
                                    }

                                    string chapatername = drIndex["chaptername"].ToString();
                                    if (name != groupName)
                                    {
                                        ltlIndex.Text += "<tr><td colspan='2' align='center' style='background-color:#D9D9D9;font-size:1.4em;'>";
                                        ltlIndex.Text += "<b>" + groupName + "</b></td></tr>";
                                    }
                                    ltlIndex.Text += "<tr><td width='200' valign='top'>";
                                    if (_indexName != indexname)
                                    {
                                        ltlIndex.Text += "<br/><a href='" + redirect + "?cat=" + category + "&subcat=" + subcategory + "&name=" + drIndex["indexname"].ToString() + (isDoc ? "' target='_blank'" : string.Empty) + "'>" + drIndex["indexname"].ToString() + "</a>";
                                    }

                                    if (chapatername == "")
                                    {
                                        ltlIndex.Text += "</td><td><br/>" + drIndex["subjects"].ToString() + "<br/></td></tr>";
                                    }
                                    name = groupName;
                                    _indexName = indexname;
                                }
                            }
                        }
                        ltlIndex.Text += "</table>";
                    }

                    else if (category == "Customs" & subcategory == "Notifications")
                    {
                        InvisibleRuleLabels();
                        InvisibleFormLabels();
                        dlIndex.Visible = true;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //invisible forms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //invisible SEZ
                        gvSEZ.Visible = false;
                        dlDGFT.Visible = false;
                        //invisible ServiceTax Data
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = true;
                        dlnontariff.Visible = true;
                        dlsafeguards.Visible = true;
                        dlCECothers.Visible = true;
                        dlSTN.Visible = false;
                        pnlSION.Visible = false;
                        CECNotifications();

                    }
                    else if (category == "Customs" & subcategory == "Acts" || subcategory == "Regulations" || subcategory == "Drawback Schedule")
                    {

                        InvisibleRuleLabels();
                        InvisibleFormLabels();
                        dlIndex.Visible = true;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //invisible forms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //invisible SEZ
                        gvSEZ.Visible = false;
                        dlDGFT.Visible = false;
                        //invisible ServiceTax Data
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        pnlSION.Visible = false;
                        ActsTableAdapter actsIndexName = new ActsTableAdapter();
                        DataTable dtActsIndexName = actsIndexName.Index_Select(subcategory);
                        if (dtActsIndexName.Rows.Count > 0)
                        {
                            dlIndex.DataSource = dtActsIndexName;
                            dlIndex.DataBind();
                        }
                    }

                    else
                    {
                        InvisibleRuleLabels();
                        InvisibleFormLabels();
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //invisible forms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //invisible SEZ
                        gvSEZ.Visible = false;
                        dlDGFT.Visible = false;
                        //invisible ServiceTax Data
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        pnlSION.Visible = false;
                        GetAllCaseLawsTableAdapter CLyear = new GetAllCaseLawsTableAdapter();
                        DataTable dtCLyear = CLyear.GetYearsByCategory(category);
                        if (dtCLyear.Rows.Count > 0)
                        {
                            ltlCaselwas.Text = string.Empty;

                            foreach (DataRow CL in dtCLyear.Rows)
                            {
                                int CLuniqueyear=(int)CL["Year"];
                                GetAllCaseLawsTableAdapter CLNumber = new GetAllCaseLawsTableAdapter();
                                DataTable dtCLNumber = CLyear.GetCLNumByYear(category, CLuniqueyear);
                                if(dtCLNumber.Rows.Count>0)

                                {
                                    string CLmaxNumberforyears = dtCLNumber.Rows[0]["maxclnum"].ToString();

                                    int CLmaxNumberforyear = Convert.ToInt32(CLmaxNumberforyears);

                                    if (CLmaxNumberforyear > 0)
                                    {
                                        int c = 1, i = 0, d = 50;
                                        ltlCaselwas.Text += "<table class='citation'><tr><th colspan='3' align='center'>Citation of Year&nbsp;" + CLuniqueyear + "</th></tr><tr>";
                                        for (int v = CLmaxNumberforyear; v > 0; )
                                        {
                                            v = v - 50;
                                            ltlCaselwas.Text += "<td align='center'><a href=displayindex.aspx?CLnum1=" + d + "&CLnum2=" + c + "&year=" + CLuniqueyear + "&cat=" + category + "&subcat=" + subcategory + ">" + c + "-" + d + "</a></td>";
                                            c = c + 50;
                                            if (++i % 3 == 0)
                                            {
                                                ltlCaselwas.Text += "</tr><tr>";
                                            }
                                            d = d + 50;
                                        }
                                        ltlCaselwas.Text += "</tr>";
                                        ltlCaselwas.Text += "</table><br/><br/>";
                                    }

                            }
                            }

                        }
                    }
                    #endregion
                }
                if (category == "Central Excise")
                {
                    #region CentralExciseIndex
                    if (category == "Central Excise" & subcategory == "Rules")
                    {
                        VisibleRuleLabels();
                        InvisibleFormLabels();
                        dlIndex.Visible = false;
                        //visible rules
                        dlAgreements.Visible = true;
                        dlBaggage.Visible = true;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //invisible froms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDGFT.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //invisible SEZ
                        gvSEZ.Visible = false;
                        //invisible ServiceTax Data
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        pnlCEManual.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;

                        lblAgreements.Text = "Central Excise Rules";
                        lblBaggage.Text = string.Empty;
                        lblCustomDrawBack.Visible = false;
                        lblCustomValuation.Visible = false;
                        lblOthers.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dlantidumpingduty.Visible = false;
                        pnlSION.Visible = false;
                        CEActsTableAdapter indexByHeadings = new CEActsTableAdapter();
                        DataTable dtAgreements = indexByHeadings.IndexByHeadings(subcategory, "Central Excise Rules");
                        dlAgreements.DataSource = dtAgreements;
                        dlAgreements.DataBind();

                        DataTable dtBaggage = indexByHeadings.IndexByHeadings(subcategory, "Rescinded or Superseded Rules");
                        dlBaggage.DataSource = dtBaggage;
                        dlBaggage.DataBind();
                    }
                    else if (category == "Central Excise" & subcategory == "Forms")
                    {
                        InvisibleRuleLabels();
                        InvisibleFormLabels();
                        //invisible all
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //invisible forms
                        dlRefunds.Visible = false;
                        dlDGFT.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //visible SEZ
                        gvSEZ.Visible = true;
                        //invisible ServiceTax Data
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        pnlSION.Visible = false;
                        CEActsTableAdapter index = new CEActsTableAdapter();
                        DataTable dtForms = index.CEForms(subcategory);
                        gvSEZ.DataSource = dtForms;
                        gvSEZ.DataBind();
                    }

                    else if (category == "Central Excise" & subcategory == "Tariff 2012-13")
                    {
                        InvisibleRuleLabels();
                        InvisibleFormLabels();
                        //invisible all
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlDGFT.Visible = false;
                        dlOthers.Visible = false;
                        //invisible forms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //visible SEZ
                        gvSEZ.Visible = true;
                        //invisible ServiceTax Data
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = false;
                        pnlSION.Visible = false;
                        DataTable dtGroups = new DataTable();
                        DataRow row = null;

                        DataColumn dcRelationShip = new DataColumn("Group");
                        dcRelationShip.DataType = System.Type.GetType("System.String");
                        dtGroups.Columns.Add(dcRelationShip);
                        row = dtGroups.NewRow();
                        row["Group"] = "General Excise Act";
                        dtGroups.Rows.Add(row);
                        row = dtGroups.NewRow();
                        row["Group"] = "Central Excise Tariff Act, 1985 and Exemption Notifications";
                        dtGroups.Rows.Add(row);
                        row = dtGroups.NewRow();
                        row["Group"] = "General Exemptions";
                        dtGroups.Rows.Add(row);
                        row = dtGroups.NewRow();
                        row["Group"] = "Appendix";
                        dtGroups.Rows.Add(row);
                        string redirect = string.Empty;
                        CentralExcise_Tariff_GetAllTableAdapter index = new CentralExcise_Tariff_GetAllTableAdapter();

                        ltlIndex.Text = "<table>";
                        foreach (DataRow drGroups in dtGroups.Rows)
                        {
                            string groupName = drGroups[0].ToString();
                            DataTable dtIndex = index.CE_Tariff_IndexByGroup(groupName);

                            if (dtIndex.Rows.Count > 0)
                            {
                                string name = string.Empty;
                                string _indexName = string.Empty;

                                foreach (DataRow drIndex in dtIndex.Rows)
                                {
                                    bool isDoc = false;
                                    string indexname = drIndex["indexname"].ToString();
                                    DataTable dtChapterbyIndex = index.CE_Tariff_ChapterByIndex(indexname);
                                    if (dtChapterbyIndex.Rows.Count > 0)
                                    {
                                        string aChapter = Convert.ToString(dtChapterbyIndex.Rows[0]["chaptername"]);
                                        if (aChapter.Equals(""))
                                        {
                                            string adata = Convert.ToString(dtChapterbyIndex.Rows[0]["data"]);
                                            isDoc = adata.Equals("");
                                            redirect = "shownotifications.aspx";
                                        }
                                        else
                                        {
                                            redirect = "displayindex.aspx";
                                        }
                                    }

                                    string chapatername = drIndex["chaptername"].ToString();
                                    if (name != groupName)
                                    {
                                        ltlIndex.Text += "<tr><td colspan='2' align='center' style='background-color:#D9D9D9;font-size:1.4em;'>";
                                        ltlIndex.Text += "<b>" + groupName + "</b></td></tr>";
                                    }
                                    ltlIndex.Text += "<tr><td width='100' valign='top'>";
                                    if (_indexName != indexname)
                                    {
                                        ltlIndex.Text += "<br/><a href='" + redirect + "?cat=" + category + "&subcat=" + subcategory + "&name=" + drIndex["indexname"].ToString() + (isDoc ? "' target='_blank'" : string.Empty) + "'>" + drIndex["indexname"].ToString() + "</a>";
                                    }

                                    if (chapatername == "")
                                    {
                                        ltlIndex.Text += "</td><td><br/>" + drIndex["subjects"].ToString() + "<br/></td></tr>";
                                    }
                                    name = groupName;
                                    _indexName = indexname;
                                }
                            }
                        }
                        ltlIndex.Text += "</table>";
                    }
                    else if (category == "Central Excise" & subcategory == "CBEC Manual")
                    {
                        InvisibleRuleLabels();
                        InvisibleFormLabels();
                        //invisible all
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //invisible forms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlDGFT.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //visible SEZ
                        gvSEZ.Visible = false;
                        //invisible ServiceTax Data
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = true;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = false;
                        pnlSION.Visible = false;
                    }
                    else if (category == "Central Excise" & subcategory == "Notifications")
                    {
                        InvisibleRuleLabels();
                        InvisibleFormLabels();
                        dlIndex.Visible = true;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //invisible forms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlDGFT.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //invisible SEZ
                        gvSEZ.Visible = false;
                        //invisible ServiceTax Data
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = true;
                        dlnontariff.Visible = true;
                        dlsafeguards.Visible = true;
                        dlCECothers.Visible = true;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = true;
                        pnlSION.Visible = false;
                        CECNotifications();
                    }

                    else  if (category == "Central Excise" & subcategory == "Case Laws" || subcategory == "Case")
                    {
                        InvisibleRuleLabels();
                        InvisibleFormLabels();
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //invisible forms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //invisible SEZ
                        gvSEZ.Visible = false;
                        dlDGFT.Visible = false;
                        //invisible ServiceTax Data
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        pnlSION.Visible = false;
                        GetAllCaseLawsTableAdapter CLyear = new GetAllCaseLawsTableAdapter();
                        DataTable dtCLyear = CLyear.GetYearsByCategory(category);
                        if (dtCLyear.Rows.Count > 0)
                        {
                            ltlCaselwas.Text = string.Empty;

                            foreach (DataRow CL in dtCLyear.Rows)
                            {
                                int CLuniqueyear = (int)CL["Year"];
                                GetAllCaseLawsTableAdapter CLNumber = new GetAllCaseLawsTableAdapter();
                                DataTable dtCLNumber = CLyear.GetCLNumByYear(category, CLuniqueyear);
                                if (dtCLNumber.Rows.Count > 0)
                                {
                                    string CLmaxNumberforyears = dtCLNumber.Rows[0]["maxclnum"].ToString();

                                    int CLmaxNumberforyear = Convert.ToInt32(CLmaxNumberforyears);

                                    if (CLmaxNumberforyear > 0)
                                    {
                                        int c = 1,i=0, d = 50;
                                        ltlCaselwas.Text += "<table class='citation'><tr><th colspan='3' align='center'>Citation of Year&nbsp;" + CLuniqueyear + "</th></tr><tr>";
                                        for (int v = CLmaxNumberforyear; v > 0; )
                                        {
                                            v = v - 50;
                                            ltlCaselwas.Text += "<td align='center'><a href=displayindex.aspx?CLnum1=" + d + "&CLnum2=" + c + "&year=" + CLuniqueyear + "&cat=Central%20Excise&subcat=Case%20Laws>" + c + "-" + d + "</a></td>";
                                            if (++i % 3 == 0)
                                            {
                                                ltlCaselwas.Text += "</tr><tr>";
                                            }
                                            c = c + 50;
                                            d = d + 50;
                                        }
                                        ltlCaselwas.Text += "</tr>";
                                        ltlCaselwas.Text += "</table><br/><br/>";

                                    }

                                }
                            }

                        }

                    }

                    else
                    {
                        InvisibleRuleLabels();
                        InvisibleFormLabels();
                        dlIndex.Visible = true;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //invisible forms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlDGFT.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //invisible SEZ
                        gvSEZ.Visible = false;
                        //invisible ServiceTax Data
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false; dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = false;
                        pnlSION.Visible = false;
                        CEActsTableAdapter index = new CEActsTableAdapter();
                        DataTable dtActsIndexName = index.CEIndex(subcategory);
                        if (dtActsIndexName.Rows.Count > 0)
                        {
                            dlIndex.DataSource = dtActsIndexName;
                            dlIndex.DataBind();
                        }
                    }

                    #endregion
                }
                if (category == "Service Tax")
                {
                    #region ServiceTax
                    if (category == "Service Tax" & subcategory == "Act 1994")
                    {
                        InvisibleFormLabels();
                        dlIndex.Visible = false;
                        //visible rules
                        dlAgreements.Visible = false;
                        gvstacts.Visible = true;
                        //  dlBaggage.Visible = true;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //invisible froms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlDGFT.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //invisible SEZ
                        gvSEZ.Visible = false;
                        pnlCEManual.Visible = false;

                        // lblAgreements.Text = "Central Excise Rules";
                        // lblBaggage.Text = "Rescinded or Superseded Rules";
                        lblCustomDrawBack.Visible = false;
                        lblCustomValuation.Visible = false;
                        lblOthers.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = false;
                        pnlSION.Visible = false;

                        ServiceTax_GetAll1TableAdapter index = new ServiceTax_GetAll1TableAdapter();

                        DataTable dtIndex = index.STAct_Index_Select(subcategory);
                        dtIndex.Columns.Add("IsDoc");
                        foreach (DataRow dr in dtIndex.Rows)
                        {
                            dr["IsDoc"] = dr["Data"] == null || dr["Data"].ToString() == string.Empty;
                        }
                        gvstacts.DataSource = dtIndex;
                        gvstacts.DataBind();

                    }
                    else if (category == "Service Tax" & subcategory == "ST Rules")
                    {
                        InvisibleRuleLabels();
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        gvstrules.Visible = true;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlDGFT.Visible = false;
                        dlOthers.Visible = false;
                        //visible froms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        lblAppeals.Visible = false;
                        lblApplicationForm.Visible = false;
                        lblBill.Visible = false;
                        lblBonds.Visible = false;

                        lblDrawback.Visible = false;
                        lblOthersApplicationForms.Visible = false;
                        lblRefunds.Visible = false;
                        lblSettlementCommission.Visible = false;
                        lblShipping.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = false;

                        //invisible SEZ
                        gvSEZ.Visible = false;

                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        pnlSION.Visible = false;
                        ServiceTax_GetAll1TableAdapter indexrules = new ServiceTax_GetAll1TableAdapter();

                        DataTable dtIndex = indexrules.STRules_Index_Select(subcategory);
                        dtIndex.Columns.Add("IsDoc");
                        foreach (DataRow dr in dtIndex.Rows)
                        {
                            dr["IsDoc"] = dr["Data"] == null || dr["Data"].ToString() == string.Empty;
                        }
                        gvstrules.DataSource = dtIndex;
                        gvstrules.DataBind();
                    }
                    else if (category == "Service Tax" & subcategory == "Forms and Registers")
                    {
                        InvisibleRuleLabels();
                        InvisibleFormLabels();
                        //invisible all
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //invisible forms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlDGFT.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //visible SEZ
                        gvSEZ.Visible = false;
                        gvservicetaxforms.Visible = true;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = false;
                        pnlSION.Visible = false;
                        ServiceTax_GetAll1TableAdapter indexforms = new ServiceTax_GetAll1TableAdapter();

                        DataTable dtIndexForms = indexforms.STForms_Index_Select(subcategory);
                        dtIndexForms.Columns.Add("IsDoc");
                        foreach (DataRow dr in dtIndexForms.Rows)
                        {
                            dr["IsDoc"] = dr["Data"] == null || dr["Data"].ToString() == string.Empty;
                        }
                        gvservicetaxforms.DataSource = dtIndexForms;
                        gvservicetaxforms.DataBind();
                    }
                    else if (category == "Service Tax" & subcategory == "Accounting Codes for new services")
                    {
                        InvisibleRuleLabels();
                        // VisibleFormLabels();
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dtstaccodes.Visible = true;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //visible froms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlDGFT.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;

                        lblAppeals.Visible = false;
                        lblApplicationForm.Visible = false;
                        lblBill.Visible = false;
                        lblBonds.Visible = false;

                        lblDrawback.Visible = false;
                        lblOthersApplicationForms.Visible = false;
                        lblRefunds.Visible = false;
                        lblSettlementCommission.Visible = false;
                        lblShipping.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;

                        //invisible SEZ
                        gvSEZ.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = false;
                        pnlSION.Visible = false;

                        ServiceTax_GetAll1TableAdapter indexaccountcodes = new ServiceTax_GetAll1TableAdapter();

                        DataTable dtIndexindexaccountcodes = indexaccountcodes.STAccountcode_Index_Select(subcategory);
                        dtstaccodes.DataSource = dtIndexindexaccountcodes;
                        dtstaccodes.DataBind();
                    }

                    else if (category == "Service Tax" & subcategory == "Case Laws")
                    {
                        InvisibleRuleLabels();
                        // VisibleFormLabels();
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dtstaccodes.Visible = false;
                        dlBaggage.Visible = false;
                        dlDGFT.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //visible froms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;

                        lblAppeals.Visible = false;
                        lblApplicationForm.Visible = false;
                        lblBill.Visible = false;
                        lblBonds.Visible = false;

                        lblDrawback.Visible = false;
                        lblOthersApplicationForms.Visible = false;
                        lblRefunds.Visible = false;
                        lblSettlementCommission.Visible = false;
                        lblShipping.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = false;

                        //invisible SEZ
                        gvSEZ.Visible = false;

                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        pnlSION.Visible = false;
                        GetAllCaseLawsTableAdapter CLyear = new GetAllCaseLawsTableAdapter();
                        DataTable dtCLyear = CLyear.GetYearsByCategory(category);
                        if (dtCLyear.Rows.Count > 0)
                        {
                            ltlCaselwas.Text = string.Empty;

                            foreach (DataRow CL in dtCLyear.Rows)
                            {
                                int CLuniqueyear = (int)CL["Year"];
                                GetAllCaseLawsTableAdapter CLNumber = new GetAllCaseLawsTableAdapter();
                                DataTable dtCLNumber = CLyear.GetCLNumByYear(category, CLuniqueyear);
                                if (dtCLNumber.Rows.Count > 0)
                                {
                                    string CLmaxNumberforyears = dtCLNumber.Rows[0]["maxclnum"].ToString();

                                    int CLmaxNumberforyear = Convert.ToInt32(CLmaxNumberforyears);

                                    if (CLmaxNumberforyear > 0)
                                    {
                                        int c = 1, i = 0, d = 50;
                                        ltlCaselwas.Text += "<table class='citation'><tr><th colspan='3' align='center'>Citation of Year&nbsp;" + CLuniqueyear + "</th></tr><tr>";
                                        for (int v = CLmaxNumberforyear; v > 0; )
                                        {
                                            v = v - 50;
                                            ltlCaselwas.Text += "<td align='center'><a href=displayindex.aspx?CLnum1=" + d + "&CLnum2=" + c + "&year=" + CLuniqueyear + "&cat=Service%20Tax&subcat=Case%20Laws>" + c + "-" + d + "</a></td>";
                                            if (++i % 3 == 0)
                                            {
                                                ltlCaselwas.Text += "</tr><tr>";
                                            }
                                            c = c + 50;
                                            d = d + 50;
                                        }
                                        ltlCaselwas.Text += "</tr>";
                                        ltlCaselwas.Text += "</table><br/><br/>";

                                    }

                                }
                            }

                        }

                    }

                    else if (category == "Service Tax" & subcategory == "Taxation of Services An Educational Guide")
                    {
                        InvisibleRuleLabels();
                        // VisibleFormLabels();
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dtstaccodes.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //visible froms
                        dlRefunds.Visible = false;
                        dlDGFT.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;

                        lblAppeals.Visible = false;
                        lblApplicationForm.Visible = false;
                        lblBill.Visible = false;
                        lblBonds.Visible = false;

                        lblDrawback.Visible = false;
                        lblOthersApplicationForms.Visible = false;
                        lblRefunds.Visible = false;
                        lblSettlementCommission.Visible = false;
                        lblShipping.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;

                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = false;
                        //invisible SEZ
                        gvSEZ.Visible = false;

                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = true;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        pnlSION.Visible = false;
                    }
                    else if (category == "Service Tax" & subcategory == "Notifications")
                    {
                        InvisibleRuleLabels();
                        InvisibleFormLabels();
                        dlIndex.Visible = true;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //invisible forms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //invisible SEZ
                        gvSEZ.Visible = false;
                        //invisible ServiceTax Data
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = true;
                        dlSTN.Visible = true;
                        pnlITActsInterest.Visible = false;
                        dlantidumpingduty.Visible = true;
                        pnlSION.Visible = false;
                        STN_GetAllTableAdapter styear = new STN_GetAllTableAdapter();
                        DataTable dtstnYear = styear.STN_Index();
                        if (dtstnYear.Rows.Count > 0)
                        {
                            dlSTN.DataSource = dtstnYear;
                            dlSTN.DataBind();
                        }

                    }

                    else
                    {
                        InvisibleRuleLabels();
                        InvisibleFormLabels();
                        dlIndex.Visible = true;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlOthers.Visible = false;
                        //invisible forms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;
                        //invisible SEZ
                        gvSEZ.Visible = false;
                        //invisible ServiceTax Data
                        gvservicetaxforms.Visible = false;
                        gvstacts.Visible = false;
                        gvstrules.Visible = false;
                        dtstaccodes.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dlantidumpingduty.Visible = false;
                        pnlSION.Visible = false;
                        //CEActsTableAdapter index = new CEActsTableAdapter();
                        //DataTable dtActsIndexName = index.CEIndex(subcategory);
                        //if (dtActsIndexName.Rows.Count > 0)
                        //{
                        //    dlIndex.DataSource = dtActsIndexName;
                        //    dlIndex.DataBind();
                        //}
                    }

                    #endregion
                }
                if (category == "Library")
                {

                    #region Library

                    // VisibleRuleLabels();
                    InvisibleFormLabels();
                    dlIndex.Visible = false;
                    //visible rules
                    dlAgreements.Visible = false;
                    dlBaggage.Visible = true;
                    dlCustomDrawBack.Visible = false;
                    dlCustomValuation.Visible = false;
                    dlOthers.Visible = false;
                    //invisible froms
                    dlRefunds.Visible = false;
                    dlAppeals.Visible = false;
                    dlDrawback.Visible = false;
                    dlOthersApplicationForms.Visible = false;
                    dlShipping.Visible = false;
                    dllBill.Visible = false;
                    dlBonds.Visible = false;
                    dlDGFT.Visible = false;
                    dlSettlementCommission.Visible = false;
                    dlSTCaseLaws.Visible = false;
                    //invisible SEZ
                    gvSEZ.Visible = false;
                    //invisible ServiceTax Data
                    gvservicetaxforms.Visible = false;
                    gvstacts.Visible = false;
                    gvstrules.Visible = false;
                    dtstaccodes.Visible = false;
                    pnlCEManual.Visible = false;
                    //invisible Circular/Instruction Headings
                    lblCircularHeading.Visible = false;
                    lblInstructionHeading.Visible = false;

                    lblAgreements.Text = string.Empty;

                    if (subcategory == "Central Excise")
                    {
                        lblBaggage.Text = "Rescinded or Superseded Rules";
                    }
                    if (subcategory == "Service Tax")
                    {
                        lblBaggage.Text = "Service Tax Libraries";
                    }
                    if (subcategory == "Customs")
                    {
                        lblBaggage.Text = "Custom Libraries";
                    }
                    if (subcategory == "Income Tax")
                    {
                        lblBaggage.Text = "Income Tax Libraries";
                    }
                    if (subcategory == "DGFT")
                    {
                        lblBaggage.Text = "DGFT Libraries";
                    }

                    lblCustomDrawBack.Visible = false;
                    lblCustomValuation.Visible = false;
                    lblOthers.Visible = false;
                    pnlSTlibraries.Visible = false;
                    pnlSTTaxation.Visible = false;
                    dlITActs.Visible = false;

                    dltariff.Visible = false;
                    dlnontariff.Visible = false;
                    dlsafeguards.Visible = false;
                    dlCECothers.Visible = false;
                    dlSTN.Visible = false;
                    dlantidumpingduty.Visible = false;
                    pnlSION.Visible = false;
                    pnlITActsGift.Visible = false;
                    pnlITActsInterest.Visible = false;

                    Library_SelectAllTableAdapter indexselect = new Library_SelectAllTableAdapter();
                    DataTable dtBaggage = indexselect.Library_Index_Select(subcategory);

                    // Library_RSRules_SelectAllTableAdapter indexByHeadings = new Library_RSRules_SelectAllTableAdapter();
                    //  DataTable dtBaggage = indexByHeadings.RSRules_Index(subcategory);
                    dlBaggage.DataSource = dtBaggage;
                    dlBaggage.DataBind();
                    #endregion
                }

                if (category == "Income Tax")
                {
                    #region Income Tax
                    if (subcategory == "Income Tax Act" || subcategory == "Wealth Tax Act" || subcategory == "Expenditure Tax Act")
                    {
                        dlITActs.Visible = true;

                        InvisibleRuleLabels();
                        // VisibleFormLabels();
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dtstaccodes.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlDGFT.Visible = false;
                        dlOthers.Visible = false;
                        //visible froms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;

                        lblAppeals.Visible = false;
                        lblApplicationForm.Visible = false;
                        lblBill.Visible = false;
                        lblBonds.Visible = false;

                        lblDrawback.Visible = false;
                        lblOthersApplicationForms.Visible = false;
                        lblRefunds.Visible = false;
                        lblSettlementCommission.Visible = false;
                        lblShipping.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;

                        //invisible SEZ
                        gvSEZ.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = false;
                        pnlSION.Visible = false;
                        IncomeTaxActs_SelectAllTableAdapter getITDetails = new IncomeTaxActs_SelectAllTableAdapter();
                        DataTable dtGetITDetails = getITDetails.GetIndex(subcategory);
                        if (dtGetITDetails.Rows.Count > 0)
                        {
                            dtGetITDetails.Columns.Add("IsDoc");
                            foreach (DataRow dr in dtGetITDetails.Rows)
                            {
                                dr["IsDoc"] = "False";
                            }
                            dlITActs.DataSource = dtGetITDetails;
                            dlITActs.DataBind();
                        }
                    }
                    if (subcategory == "Finance Act")
                    {
                        dlITActs.Visible = false;

                        InvisibleRuleLabels();
                        // VisibleFormLabels();
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dtstaccodes.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlDGFT.Visible = false;
                        dlOthers.Visible = false;
                        //visible froms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;

                        lblAppeals.Visible = false;
                        lblApplicationForm.Visible = false;
                        lblBill.Visible = false;
                        lblBonds.Visible = false;

                        lblDrawback.Visible = false;
                        lblOthersApplicationForms.Visible = false;
                        lblRefunds.Visible = false;
                        lblSettlementCommission.Visible = false;
                        lblShipping.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = false;
                        //invisible SEZ
                        gvSEZ.Visible = false;

                        pnlSTlibraries.Visible = true;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        pnlSION.Visible = false;
                        IncomeTaxActs_SelectAllTableAdapter getITDetails = new IncomeTaxActs_SelectAllTableAdapter();
                        DataTable dtGetITDetails = getITDetails.GetFinanceActsDetails(subcategory);
                        if (dtGetITDetails.Rows.Count > 0)
                        {
                            ltlIndex.Text = "<table width='100%'>";
                            string _group = string.Empty;
                            string _indexName = string.Empty;
                            foreach (DataRow drGetITDetails in dtGetITDetails.Rows)
                            {
                                string group = drGetITDetails["Groups"].ToString();
                                string indexName = drGetITDetails["IndexName"].ToString();

                                if (_group != group)
                                {
                                    ltlIndex.Text += "<tr height='10px'><td align='center' style='background-color:#D9D9D9;font-size:1.4em;'>" + group + "<br/><br/></td></tr>";
                                }
                                ltlIndex.Text += "<tr><td style='font-size:10.0pt;font-family:Verdana,sans-serif;mso-bidi-font-family:Times'><a href='shownotifications.aspx?name=" + indexName + "+&cat=" + category + "&subcat=" + subcategory + "'>" + indexName + "</a><br/><br/></td></tr>";
                                _group = group;
                            }
                            ltlIndex.Text += "</table>";
                        }
                    }
                    if (subcategory == "Interest Tax Act")
                    {
                        pnlITActsInterest.Visible = true;

                        InvisibleRuleLabels();
                        // VisibleFormLabels();
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dtstaccodes.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlDGFT.Visible = false;
                        dlOthers.Visible = false;
                        //visible froms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;

                        lblAppeals.Visible = false;
                        lblApplicationForm.Visible = false;
                        lblBill.Visible = false;
                        lblBonds.Visible = false;

                        lblDrawback.Visible = false;
                        lblOthersApplicationForms.Visible = false;
                        lblRefunds.Visible = false;
                        lblSettlementCommission.Visible = false;
                        lblShipping.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = false;
                        //invisible SEZ
                        gvSEZ.Visible = false;

                        pnlSTlibraries.Visible = true;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        pnlSTlibraries.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlSION.Visible = false;
                    }

                    if (subcategory == "Gift Tax Act")
                    {
                        pnlITActsGift.Visible = true;

                        InvisibleRuleLabels();
                        // VisibleFormLabels();
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dtstaccodes.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlDGFT.Visible = false;
                        dlOthers.Visible = false;
                        //visible froms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;

                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = false;
                        lblAppeals.Visible = false;
                        lblApplicationForm.Visible = false;
                        lblBill.Visible = false;
                        lblBonds.Visible = false;

                        lblDrawback.Visible = false;
                        lblOthersApplicationForms.Visible = false;
                        lblRefunds.Visible = false;
                        lblSettlementCommission.Visible = false;
                        lblShipping.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;

                        //invisible SEZ
                        gvSEZ.Visible = false;

                        pnlSTlibraries.Visible = true;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        pnlSTlibraries.Visible = false;
                        dlITActs.Visible = false;
                        pnlITActsInterest.Visible = false;
                        pnlSION.Visible = false;

                    }
                    if (subcategory == "Income Tax Rules" || subcategory == "Other Direct Tax Rules")
                    {
                        dlITActs.Visible = true;

                        InvisibleRuleLabels();
                        // VisibleFormLabels();
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dtstaccodes.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlDGFT.Visible = false;
                        dlOthers.Visible = false;
                        //visible froms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;

                        lblAppeals.Visible = false;
                        lblApplicationForm.Visible = false;
                        lblBill.Visible = false;
                        lblBonds.Visible = false;

                        lblDrawback.Visible = false;
                        lblOthersApplicationForms.Visible = false;
                        lblRefunds.Visible = false;
                        lblSettlementCommission.Visible = false;
                        lblShipping.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;

                        //invisible SEZ
                        gvSEZ.Visible = false;

                        pnlSTlibraries.Visible = true;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        pnlSTlibraries.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = false;
                        pnlSION.Visible = false;

                        IncomeTaxRules_SelectAllTableAdapter getITDetails = new IncomeTaxRules_SelectAllTableAdapter();
                        DataTable dtGetITDetails = getITDetails.GetIndex(subcategory);
                        if (dtGetITDetails.Rows.Count > 0)
                        {
                            dtGetITDetails.Columns.Add("IsDoc");
                            foreach (DataRow dr in dtGetITDetails.Rows)
                            {
                                dr["IsDoc"] = "False";
                            }
                            dlITActs.DataSource = dtGetITDetails;
                            dlITActs.DataBind();
                        }
                    }
                    if (subcategory == "Circulars" || subcategory == "Notifications")
                    {
                        dlITActs.Visible = true;

                        InvisibleRuleLabels();
                        // VisibleFormLabels();
                        dlIndex.Visible = false;
                        //invisible rules
                        dlAgreements.Visible = false;
                        dtstaccodes.Visible = false;
                        dlBaggage.Visible = false;
                        dlCustomDrawBack.Visible = false;
                        dlCustomValuation.Visible = false;
                        dlDGFT.Visible = false;
                        dlOthers.Visible = false;
                        //visible froms
                        dlRefunds.Visible = false;
                        dlAppeals.Visible = false;
                        dlDrawback.Visible = false;
                        dlOthersApplicationForms.Visible = false;
                        dlShipping.Visible = false;
                        dllBill.Visible = false;
                        dlBonds.Visible = false;
                        dlSettlementCommission.Visible = false;
                        dlSTCaseLaws.Visible = false;

                        lblAppeals.Visible = false;
                        lblApplicationForm.Visible = false;
                        lblBill.Visible = false;
                        lblBonds.Visible = false;

                        lblDrawback.Visible = false;
                        lblOthersApplicationForms.Visible = false;
                        lblRefunds.Visible = false;
                        lblSettlementCommission.Visible = false;
                        lblShipping.Visible = false;
                        //invisible Circular/Instruction Headings
                        lblCircularHeading.Visible = false;
                        lblInstructionHeading.Visible = false;
                        pnlSTlibraries.Visible = false;

                        //invisible SEZ
                        gvSEZ.Visible = false;
                        pnlSTTaxation.Visible = false;
                        pnlCEManual.Visible = false;
                        pnlITActsGift.Visible = false;
                        pnlITActsInterest.Visible = false;
                        dltariff.Visible = false;
                        dlnontariff.Visible = false;
                        dlsafeguards.Visible = false;
                        dlCECothers.Visible = false;
                        dlSTN.Visible = false;
                        dlantidumpingduty.Visible = false;
                        pnlSION.Visible = false;
                        IncomeTaxCircularsNotification_SelectAllTableAdapter getITDetails = new IncomeTaxCircularsNotification_SelectAllTableAdapter();
                        DataTable dtGetITDetails = getITDetails.GetIndex(subcategory);
                        if (dtGetITDetails.Rows.Count > 0)
                        {
                            dtGetITDetails.Columns.Add("IsDoc");
                            foreach (DataRow dr in dtGetITDetails.Rows)
                            {
                                dr["IsDoc"] = dr["Data"] == null || dr["Data"].ToString() == string.Empty;
                            }
                            dlITActs.DataSource = dtGetITDetails;
                            dlITActs.DataBind();
                        }
                    }
                    #endregion
                }
                if (category == "DGFT" && subcategory == "FTDR Notifications")
                {
                    #region DGFFTDR

                    InvisibleRuleLabels();
                    InvisibleFormLabels();
                    //invisible all
                    dlIndex.Visible = false;
                    //invisible rules
                    dlAgreements.Visible = false;
                    dlBaggage.Visible = false;
                    dlCustomDrawBack.Visible = false;
                    dlCustomValuation.Visible = false;
                    dlOthers.Visible = false;
                    //invisible forms
                    dlRefunds.Visible = false;
                    dlAppeals.Visible = false;
                    dlDrawback.Visible = false;
                    dlOthersApplicationForms.Visible = false;
                    dlShipping.Visible = false;
                    dllBill.Visible = false;
                    dlBonds.Visible = false;
                    dlSettlementCommission.Visible = false;
                    dlSTCaseLaws.Visible = false;
                    //visible SEZ
                    gvSEZ.Visible = false;
                    //invisible ServiceTax Data
                    gvservicetaxforms.Visible = false;
                    gvstacts.Visible = false;
                    gvstrules.Visible = false;
                    dtstaccodes.Visible = false;
                    //invisible Circular/Instruction Headings
                    lblCircularHeading.Visible = false;
                    lblInstructionHeading.Visible = false;
                    pnlSTlibraries.Visible = false;
                    pnlSTTaxation.Visible = false;
                    pnlCEManual.Visible = false;
                    dlDGFT.Visible = true;
                    dlITActs.Visible = false;
                    pnlITActsGift.Visible = false;
                    pnlITActsInterest.Visible = false;
                    dlantidumpingduty.Visible = false;
                    pnlSION.Visible = false;

                    dltariff.Visible = false;
                    dlnontariff.Visible = false;
                    dlsafeguards.Visible = false;
                    dlCECothers.Visible = false;
                    dlSTN.Visible = false;
                    DGFT_FTDR_Notifications_GetAllTableAdapter indexBySubCategeory = new DGFT_FTDR_Notifications_GetAllTableAdapter();
                    DataTable dtDGFTFTDR = indexBySubCategeory.DGFT_FTDRNotification_Index(subcategory);
                    dlDGFT.DataSource = dtDGFTFTDR;
                    dlDGFT.DataBind();

                    #endregion

                } if (category == "DGFT" && subcategory == "FTP")
                {
                    #region DGFFTP

                    InvisibleRuleLabels();
                    InvisibleFormLabels();
                    //invisible all
                    dlIndex.Visible = false;
                    //invisible rules
                    dlAgreements.Visible = false;
                    dlBaggage.Visible = false;
                    dlCustomDrawBack.Visible = false;
                    dlCustomValuation.Visible = false;
                    dlOthers.Visible = false;
                    //invisible forms
                    dlRefunds.Visible = false;
                    dlAppeals.Visible = false;
                    dlDrawback.Visible = false;
                    dlOthersApplicationForms.Visible = false;
                    dlShipping.Visible = false;
                    dllBill.Visible = false;
                    dlBonds.Visible = false;
                    dlSettlementCommission.Visible = false;
                    dlSTCaseLaws.Visible = false;
                    //visible SEZ
                    gvSEZ.Visible = false;
                    //invisible ServiceTax Data
                    gvservicetaxforms.Visible = false;
                    gvstacts.Visible = false;
                    gvstrules.Visible = false;
                    dtstaccodes.Visible = false;
                    //invisible Circular/Instruction Headings
                    lblCircularHeading.Visible = false;
                    lblInstructionHeading.Visible = false; dlantidumpingduty.Visible = false;
                    pnlSTlibraries.Visible = false;
                    pnlSTTaxation.Visible = false;
                    pnlCEManual.Visible = false;
                    dlDGFT.Visible = true;
                    dlITActs.Visible = false;
                    pnlITActsGift.Visible = false;
                    pnlITActsInterest.Visible = false;
                    pnlSION.Visible = false;

                    dltariff.Visible = false;
                    dlnontariff.Visible = false;
                    dlsafeguards.Visible = false;
                    dlCECothers.Visible = false;
                    dlSTN.Visible = false;
                    DGFT_GetAllTableAdapter indexBySubCategeory = new DGFT_GetAllTableAdapter();
                    DataTable dtDGFTFTP = indexBySubCategeory.DGFT_FTP_Inde_select(subcategory);
                    dlDGFT.DataSource = dtDGFTFTP;
                    dlDGFT.DataBind();

                    #endregion
                }

                if (category == "DGFT" && subcategory == "public notices")
                {
                    #region DGFTpublicnotices

                    InvisibleRuleLabels();
                    InvisibleFormLabels();
                    //invisible all
                    dlIndex.Visible = false;
                    //invisible rules
                    dlAgreements.Visible = false;
                    dlBaggage.Visible = false;
                    dlCustomDrawBack.Visible = false;
                    dlCustomValuation.Visible = false;
                    dlOthers.Visible = false;
                    //invisible forms
                    dlRefunds.Visible = false;
                    dlAppeals.Visible = false;
                    dlDrawback.Visible = false;
                    dlOthersApplicationForms.Visible = false;
                    dlShipping.Visible = false;
                    dllBill.Visible = false;
                    dlBonds.Visible = false;
                    dlSettlementCommission.Visible = false;
                    dlSTCaseLaws.Visible = false;
                    //visible SEZ
                    gvSEZ.Visible = false;
                    //invisible ServiceTax Data
                    gvservicetaxforms.Visible = false;
                    gvstacts.Visible = false;
                    gvstrules.Visible = false;
                    dtstaccodes.Visible = false;
                    //invisible Circular/Instruction Headings
                    lblCircularHeading.Visible = false;
                    lblInstructionHeading.Visible = false;
                    pnlSTlibraries.Visible = false;
                    pnlSTTaxation.Visible = false;
                    pnlCEManual.Visible = false;
                    dlDGFT.Visible = true;
                    dlITActs.Visible = false;
                    pnlITActsGift.Visible = false; dlantidumpingduty.Visible = false;
                    pnlITActsInterest.Visible = false;
                    pnlSION.Visible = false;
                    dltariff.Visible = false;
                    dlnontariff.Visible = false;
                    dlsafeguards.Visible = false;
                    dlCECothers.Visible = false;
                    dlSTN.Visible = false;

                    DGFT_GetAllTableAdapter indexBySubCategeory = new DGFT_GetAllTableAdapter();
                    DataTable dtDGFTpublicnotice = indexBySubCategeory.DGFT_publicnotices_Index_select();
                    dlDGFT.DataSource = dtDGFTpublicnotice;
                    dlDGFT.DataBind();
                    #endregion

                }
                if (category == "DGFT" && subcategory == "SION")
                {
                    #region DGFTSION

                    pnlSION.Visible = true;

                    InvisibleRuleLabels();
                    InvisibleFormLabels();
                    //invisible all
                    dlIndex.Visible = false;
                    //invisible rules
                    dlAgreements.Visible = false;
                    dlBaggage.Visible = false;
                    dlCustomDrawBack.Visible = false;
                    dlCustomValuation.Visible = false;
                    dlOthers.Visible = false;
                    //invisible forms
                    dlRefunds.Visible = false;
                    dlAppeals.Visible = false;
                    dlDrawback.Visible = false;
                    dlOthersApplicationForms.Visible = false;
                    dlShipping.Visible = false;
                    dllBill.Visible = false;
                    dlBonds.Visible = false;
                    dlSettlementCommission.Visible = false;
                    dlSTCaseLaws.Visible = false;
                    //visible SEZ
                    gvSEZ.Visible = false;
                    //invisible ServiceTax Data
                    gvservicetaxforms.Visible = false;
                    gvstacts.Visible = false;
                    gvstrules.Visible = false;
                    dtstaccodes.Visible = false;
                    //invisible Circular/Instruction Headings
                    lblCircularHeading.Visible = false;
                    lblInstructionHeading.Visible = false; dlantidumpingduty.Visible = false;
                    pnlSTlibraries.Visible = false;
                    pnlSTTaxation.Visible = false;
                    pnlCEManual.Visible = false;
                    dlDGFT.Visible = false;
                    dlITActs.Visible = false;
                    pnlITActsGift.Visible = false;
                    pnlITActsInterest.Visible = false;

                    dltariff.Visible = false;
                    dlnontariff.Visible = false;
                    dlsafeguards.Visible = false;
                    dlCECothers.Visible = false;
                    dlSTN.Visible = false;

                    #endregion
                }

            }
        }
        public void libraryinsert()
        {
            if (rdbUploadType.SelectedValue == "Upload the Document")
            {
                UploadPDF();
            }

            Library_SelectAllTableAdapter insertlibrary = new Library_SelectAllTableAdapter();
            insertlibrary.Insert(ddlsubcategory.SelectedValue, txtindexlibrary.Text, edtData.Content, bytes);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string category = Convert.ToString(Request.QueryString["cat"]);

            if (category == "Central")
            {
                category = "Central Excise";
                 subcategeory = "Case Laws";
            }

            else if (category == "Service")
            {
                category = "Service Tax";
                 subcategeory = "Case Laws";
            }

            else
            {
                 subcategeory = Request.QueryString["subcat"];
            }

            string indexName = Request.QueryString["name"];
            string chapter = Request.QueryString["chaptername"];
            string citation = Request.QueryString["citation"];
            cNumber = Convert.ToString(Request.QueryString["cnums"]);
            fNumber = Convert.ToString(Request.QueryString["fnums"]);
            year = Convert.ToString(Request.QueryString["years"]);
            string notification = Request.QueryString["notificationname"];
            string notificationnum = Convert.ToString(Request.QueryString["CECNnum"]);
            string STNnotificationnum = Convert.ToString(Request.QueryString["STNnum"]);

            #region Circulars/Instructions
            if (subcategeory == "Circulars/Instructions")
            {
                if (cNumber != "")
                {
                    Instructions_Data_ByCnumberTableAdapter getDatByCnumber = new Instructions_Data_ByCnumberTableAdapter();
                    DataTable dtDatByCnumber = getDatByCnumber.GetDatabyCnumber(cNumber, category, year);

                    if (dtDatByCnumber.Rows.Count > 0)
                    {
                        ltl.Text = Convert.ToString(dtDatByCnumber.Rows[0]["Data"]);

                    }
                }
                if (fNumber != "")
                {

                    Instructions1_Data_ByCnumberTableAdapter getDataByFnumber = new Instructions1_Data_ByCnumberTableAdapter();
                    DataTable dtDataByFnumber = getDataByFnumber.InstructionsData(fNumber, category, year);

                    if (dtDataByFnumber.Rows.Count > 0)
                    {
                        ltl.Text = Convert.ToString(dtDataByFnumber.Rows[0]["Data"]);

                    }
                }
            }
            #endregion

            #region Customs Tariff

            else if (category == "Customs" && subcategeory == "Tariff 2012-13")
            {
                if (indexName == null && chapter != "")
                {
                    Custom_Tariff_DataByChapteNameTableAdapter getDataByChapteName = new Custom_Tariff_DataByChapteNameTableAdapter();
                    DataTable dtDataByChapteName = getDataByChapteName.GetCTDataByChapterName(chapter);

                    if (dtDataByChapteName.Rows.Count > 0)
                    {

                        string tchaptername = Convert.ToString(dtDataByChapteName.Rows[0]["ChapterName"].ToString());
                        if (tchaptername != "")
                        {
                            string tdata = Convert.ToString(dtDataByChapteName.Rows[0]["Data"].ToString());
                            if (tdata != "")
                            {
                                ltl.Text = Convert.ToString(dtDataByChapteName.Rows[0]["Data"]);
                            }
                            else
                            {
                                byte[] b = ((byte[])dtDataByChapteName.Rows[0]["Document"]);
                                //Collect Bytes from database and write in Webpage
                                Response.ContentType = "application/pdf";
                                Response.BinaryWrite(b);
                                Response.Write("<script>window.open('Page.html','_blank')</script>");
                            }
                        }
                    }

                }

                else
                {

                    Custom_Tariff_DataByIndexNameTableAdapter getDataByIndexName = new Custom_Tariff_DataByIndexNameTableAdapter();
                    DataTable dtDataByIndexName = getDataByIndexName.GetCTDataByIndexName(indexName);
                    string tdata = Convert.ToString(dtDataByIndexName.Rows[0]["Data"].ToString());
                    if (tdata != "")
                    {
                        ltl.Text = Convert.ToString(dtDataByIndexName.Rows[0]["Data"]);

                    }
                    else
                    {

                        byte[] b = ((byte[])dtDataByIndexName.Rows[0]["Document"]);
                        //Collect Bytes from database and write in Webpage
                        Response.ContentType = "application/pdf";
                        Response.BinaryWrite(b);
                        Response.Write("<script>window.open('Page.html','_blank')</script>");

                    }
                }

            }
            #endregion

            #region Central Excise Tariff

            else if (category == "Central Excise" && subcategeory == "Tariff 2012-13")
            {
                if (indexName == null && chapter != "")
                {
                    CE_Tariff_DataByChapteNameTableAdapter getDataByChapteName = new CE_Tariff_DataByChapteNameTableAdapter();
                    DataTable dtDataByChapteName = getDataByChapteName.CE_Tariff_DataByChapter(chapter);
                    if (dtDataByChapteName.Rows.Count > 0)
                    {

                        string tchaptername = Convert.ToString(dtDataByChapteName.Rows[0]["ChapterName"].ToString());
                        if (tchaptername != "")
                        {
                            string tdata = Convert.ToString(dtDataByChapteName.Rows[0]["Data"].ToString());
                            if (tdata != "")
                            {
                                ltl.Text = Convert.ToString(dtDataByChapteName.Rows[0]["Data"]);
                            }
                            else
                            {
                                byte[] b = ((byte[])dtDataByChapteName.Rows[0]["Document"]);
                                //Collect Bytes from database and write in Webpage
                                Response.ContentType = "application/pdf";
                                Response.BinaryWrite(b);
                                Response.Write("<script>window.open('Page.html','_blank')</script>");
                            }
                        }
                    }

                }
                else
                {

                    CentralExcise_Tariff_GetAllTableAdapter getDataByIndexName = new CentralExcise_Tariff_GetAllTableAdapter();
                    DataTable dtDataByIndexName = getDataByIndexName.CE_Tariff_DataByIndex(indexName);
                    string tdata = Convert.ToString(dtDataByIndexName.Rows[0]["Data"].ToString());
                    if (tdata != "")
                    {
                        ltl.Text = Convert.ToString(dtDataByIndexName.Rows[0]["Data"]);

                    }
                    else
                    {

                        byte[] b = ((byte[])dtDataByIndexName.Rows[0]["Document"]);
                        //Collect Bytes from database and write in Webpage
                        Response.ContentType = "application/pdf";
                        Response.BinaryWrite(b);
                        Response.Write("<script>window.open('Page.html','_blank')</script>");

                    }
                }
            }
            #endregion

            #region Service Tax CaseLaws
            //else if (category == "Service Tax" && subcategeory == "Case Laws")
            //{
            //    STCaselaws_GetAllTableAdapter getSTCaselawsDataByindex = new STCaselaws_GetAllTableAdapter();
            //    DataTable dtSTCaselawsDataByindex = getSTCaselawsDataByindex.GetDataByIndexName(indexName);

            //    string stcl = Convert.ToString(dtSTCaselawsDataByindex.Rows[0]["Data"]);

            //    if (stcl != null)
            //    {
            //        ltl.Text = Convert.ToString(dtSTCaselawsDataByindex.Rows[0]["Data"]);
            //    }
            //    else
            //    {
            //        byte[] b = ((byte[])dtSTCaselawsDataByindex.Rows[0]["Document"]);
            //        //Collect Bytes from database and write in Webpage
            //        Response.ContentType = "application/pdf";
            //        Response.BinaryWrite(b);
            //        Response.Write("<script>window.open('Page.html','_blank')</script>");
            //    }

            //}
            #endregion

            #region STLibraries
            else if (category == "Library" && subcategeory == "Libraries")
            {
                string path = HttpContext.Current.Server.MapPath("faq-29sept11.pdf");
                System.Net.WebClient client = new System.Net.WebClient();
                Byte[] buffer = client.DownloadData(path);

                if (buffer != null)
                {
                    Response.ContentType = "application/pdf";
                    Response.AddHeader("content-length", buffer.Length.ToString());
                    Response.TransmitFile(path);

                    //Response.BinaryWrite(buffer);
                }

            }
            #endregion

            #region STTaxation
            else if (category == "Service Tax" && subcategeory == "Taxation of Services: An Educational Guide")
            {
                string path = HttpContext.Current.Server.MapPath("st-edu-guide.pdf");
                System.Net.WebClient client = new System.Net.WebClient();
                Byte[] buffer = client.DownloadData(path);

                if (buffer != null)
                {
                    Response.ContentType = "application/pdf";
                    Response.AddHeader("content-length", buffer.Length.ToString());
                    Response.TransmitFile(path);
                }

            }
            #endregion

            #region CEManual
            else if (category == "Service Tax" && subcategeory == "CBEC Manual")
            {
                string path = HttpContext.Current.Server.MapPath("cx-manual.pdf");
                System.Net.WebClient client = new System.Net.WebClient();
                Byte[] buffer = client.DownloadData(path);

                if (buffer != null)
                {
                    Response.ContentType = "application/pdf";
                    Response.AddHeader("content-length", buffer.Length.ToString());
                    Response.TransmitFile(path);
                }

            }
            #endregion

            #region CECNotifications
            else if (subcategeory == "Notifications" & (category == "Customs" || category == "Central Excise"))
            {

                DataTable dtcectdata = null;
                CECNotification_GetAllTableAdapter cectdata = new CECNotification_GetAllTableAdapter();
                switch (notification)
                {
                    case "Tariff":

                        dtcectdata = cectdata.CEC_notificatondata_ByTnum(notificationnum, category, year);
                        break;
                    case "Non-Tariff":
                        dtcectdata = cectdata.CEC_notificatondata_ByNTnum(notificationnum, category, year);
                        break;
                    case "Safeguards":
                        dtcectdata = cectdata.CEC_notificatondata_BySnum(notificationnum, category, year);
                        break;
                    case "Anti Dumping Duty":
                        dtcectdata = cectdata.CEC_notificationdata_ByADDNum(notificationnum, category, year);
                        break;
                    case "Others":
                        dtcectdata = cectdata.CEC_notificationdata_ByOthersnum(notificationnum, category, year);
                        break;
                }

                string stcl = Convert.ToString(dtcectdata.Rows[0]["Data"]);

                if (stcl != null)
                {
                    ltl.Text = Convert.ToString(dtcectdata.Rows[0]["Data"]);
                }
                else
                {
                    byte[] b = ((byte[])dtcectdata.Rows[0]["Document"]);
                    //Collect Bytes from database and write in Webpage
                    Response.ContentType = "application/pdf";
                    Response.BinaryWrite(b);
                    Response.Write("<script>window.open('Page.html','_blank')</script>");
                }
            }
            #endregion

            #region  STNotifications

            else if (category == "Service Tax" && subcategeory == "Notifications")
            {
                STN_GetAllTableAdapter stnshow = new STN_GetAllTableAdapter();
                DataTable dtstnshow = stnshow.STN_DataByFnum(STNnotificationnum, subcategeory, year);
                string stcl = Convert.ToString(dtstnshow.Rows[0]["Data"]);

                if (stcl != null)
                {
                    ltl.Text = Convert.ToString(dtstnshow.Rows[0]["Data"]);
                }
                else
                {
                    byte[] b = ((byte[])dtstnshow.Rows[0]["Document"]);
                    //Collect Bytes from database and write in Webpage
                    Response.ContentType = "application/pdf";
                    Response.BinaryWrite(b);
                    Response.Write("<script>window.open('Page.html','_blank')</script>");
                }
            }

            #endregion

            #region DGFT
                        else if (category == "DGFT" & subcategeory == "public notices")
            {
                DGFTpublicnotices_GETALLTableAdapter DGFTNoticenum = new DGFTpublicnotices_GETALLTableAdapter();
               DataTable dtChapterName = DGFTNoticenum.DGFT_publicnoticdata(indexName, chapter);
               string stcl = Convert.ToString(dtChapterName.Rows[0]["Data"]);

               if (stcl != null)
               {
                   ltl.Text = Convert.ToString(dtChapterName.Rows[0]["Data"]);
               }
               else
               {
                   byte[] b = ((byte[])dtChapterName.Rows[0]["Document"]);
                   //Collect Bytes from database and write in Webpage
                   Response.ContentType = "application/pdf";
                   Response.BinaryWrite(b);
                   Response.Write("<script>window.open('Page.html','_blank')</script>");
               }
            }
            else if (category == "DGFT" & subcategeory == "FTDR Notifications")
            {
                DGFT_FTDR_Notifications_GetAllTableAdapter DGFTNoticenum = new DGFT_FTDR_Notifications_GetAllTableAdapter();
               DataTable dtChapterName = DGFTNoticenum.DGFT_FTDRnotic_Data(indexName, chapter);
               string stcl = Convert.ToString(dtChapterName.Rows[0]["Data"]);

               if (stcl != null)
               {
                   ltl.Text = Convert.ToString(dtChapterName.Rows[0]["Data"]);
               }
               else
               {
                   byte[] b = ((byte[])dtChapterName.Rows[0]["Document"]);
                   //Collect Bytes from database and write in Webpage
                   Response.ContentType = "application/pdf";
                   Response.BinaryWrite(b);
                   Response.Write("<script>window.open('Page.html','_blank')</script>");
               }

            }
            #endregion

            #region Library
             else if (category == "Library")
                {
                    Library_SelectAllTableAdapter LibraryData = new Library_SelectAllTableAdapter();
                    //Library_RSRules_SelectAllTableAdapter CEActsChapter = new Library_RSRules_SelectAllTableAdapter();
                   DataTable dtChapterName = LibraryData.Library_Data_Select(subcategeory, indexName);

                    string stcl = Convert.ToString(dtChapterName.Rows[0]["Data"]);

                    if (stcl != null & stcl !="")
                    {
                        ltl.Text = Convert.ToString(dtChapterName.Rows[0]["Data"]);
                    }
                    else
                    {
                        byte[] b = ((byte[])dtChapterName.Rows[0]["Document"]);
                        //Collect Bytes from database and write in Webpage
                        Response.ContentType = "application/pdf";
                        Response.BinaryWrite(b);
                        Response.Write("<script>window.open('Page.html','_blank')</script>");
                    }

                }
            #endregion

            #region Caselaws
            else if (subcategeory == "Case Laws" || subcategeory == "Case")
              {
                  GetAllCaseLawsTableAdapter getdatabycitation = new GetAllCaseLawsTableAdapter();
                  DataTable dtgetdatabycitation = getdatabycitation.GetDataByCitation(category, citation);

                  if (dtgetdatabycitation.Rows.Count > 0)
                  {
                      string strCourt = "";
                      if (dtgetdatabycitation.Rows[0]["Court"].ToString().Contains("CESTAT"))
                      {
                          strCourt="CUSTOMS, EXCISE AND SERVICE TAX APPELLATE TRIBUNAL<br/>"+dtgetdatabycitation.Rows[0]["Bench"];
                      }
                      else
                      {
                          strCourt=dtgetdatabycitation.Rows[0]["Court"]+" "+dtgetdatabycitation.Rows[0]["Bench"];
                      }

                      LtlCaselaws.Text += "<table class='citCase' width='100%'  align='center'><tr><th width='100%' align='center'>" + citation.ToUpper() + "</th></tr><tr>";
                      LtlCaselaws.Text += "<td width='100%' align='center'>" + strCourt.ToUpper() + "</td></tr><tr>";
                      LtlCaselaws.Text += "<td align='center'>" + dtgetdatabycitation.Rows[0]["CaseNumber"] + "</td></tr><tr>";
                      LtlCaselaws.Text += "<td align='center' class='parties'>";
                      LtlCaselaws.Text += dtgetdatabycitation.Rows[0]["APPELLANTParty"].ToString().ToUpper() + "<br/>Vs.<br/>";
                      LtlCaselaws.Text += dtgetdatabycitation.Rows[0]["RESPONDENTParty"].ToString().ToUpper() + "</td></tr><tr><td  align='left'>";
                      LtlCaselaws.Text += dtgetdatabycitation.Rows[0]["JudgesName"] + "</td></tr><tr><td  align='right'>";
                      LtlCaselaws.Text +="Dated:&nbsp;" +((DateTime)dtgetdatabycitation.Rows[0]["DateofDecision"]).ToString("MMMM dd, yyyy") + "</td></tr><tr><td style='text-align:left' align='justify'>";
                      LtlCaselaws.Text += dtgetdatabycitation.Rows[0]["HeadNotes"] + "</td></tr><tr><td>&nbsp;</td></tr><tr><td></td></tr>";

                      LtlCaselaws.Text += "<tr><td style='font-weight:normal' align='justify'>";

                      LtlCaselaws.Text += dtgetdatabycitation.Rows[0]["JUDGEMENTContent"] + "</td></tr>";
                      LtlCaselaws.Text += "<tr><td style='padding:45px;font-style:italic;font-weight:normal;text-align:left' align='justify'><font face='Verdana, Arial, Helvetica, sans-serif' color='#666666' size='1'>(<b style='font-weight:bold'>DISCLAIMER</b>: Though all efforts have been made to reproduce the order correctly but the access and circulation is subject to the condition that TaxgenieOnline are not responsible/liable for any loss or damage caused to anyone due to any mistake/error/omissions.)</font></td></tr>";
                      LtlCaselaws.Text += "</table>";
                  }
               }

            #endregion

            else
            {
                DataTable dtChapterName = new DataTable();

                if (category == "Customs")
                {
                    ActsTableAdapter chapterName = new ActsTableAdapter();
                    dtChapterName = chapterName.Data_Select(subcategeory, indexName);
                }
                else if (category == "Central Excise")
                {
                    CEActsTableAdapter CEActsChapter = new CEActsTableAdapter();
                    dtChapterName = CEActsChapter.CEData(subcategeory, indexName);
                }
                else if (category == "Service Tax")
                {
                    ServiceTax_GetAll1TableAdapter STchaptername = new ServiceTax_GetAll1TableAdapter();
                    dtChapterName = STchaptername.GetSTData(subcategeory, indexName);
                }

                else if (category == "DGFT" & subcategeory == "FTP")
                {
                    DGFT_GetAllTableAdapter FTPchapterName = new DGFT_GetAllTableAdapter();
                    dtChapterName = FTPchapterName.DGFT_FTP_Data_select(subcategeory, indexName);
                }

                else if (category == "Income Tax" & (subcategeory == "Income Tax Act" || subcategeory == "Wealth Tax Act" || subcategeory == "Expenditure Tax Act" || subcategeory == "Finance Act"))
                {
                    IncomeTaxActs_SelectAllTableAdapter itActsData = new IncomeTaxActs_SelectAllTableAdapter();
                    dtChapterName = itActsData.GetDataByIndex(subcategeory, indexName);
                }

                else if (category == "Income Tax" & (subcategeory == "Income Tax Rules" || subcategeory == "Other Direct Tax Rules"))
                {
                    IncomeTaxRules_SelectAllTableAdapter itActsData = new IncomeTaxRules_SelectAllTableAdapter();
                    dtChapterName = itActsData.GetDataByIndex(subcategeory, indexName);
                }

                else if (category == "Income Tax" & (subcategeory == "Circulars" || subcategeory == "Notifications"))
                {
                    IncomeTaxCircularsNotification_SelectAllTableAdapter itActsData = new IncomeTaxCircularsNotification_SelectAllTableAdapter();
                    dtChapterName = itActsData.GetDataByIndex(subcategeory, indexName);
                }

                if (dtChapterName.Rows.Count > 0)
                {
                    string aChapterName = Convert.ToString(dtChapterName.Rows[0]["ChapterName"].ToString());
                    string aSections = Convert.ToString(dtChapterName.Rows[0]["Sections"].ToString());
                    string adata = Convert.ToString(dtChapterName.Rows[0]["Data"].ToString());
                    string aDocumenet = Convert.ToString(dtChapterName.Rows[0]["Document"].ToString());

                    if (aChapterName == "" & aSections == "" & aDocumenet == "")
                    {
                        ltl.Text = Convert.ToString(dtChapterName.Rows[0]["Data"]);
                    }
                    else if (aChapterName == "" & aSections == "" & adata == "")
                    {
                        byte[] b = ((byte[])dtChapterName.Rows[0]["Document"]);
                        //Collect Bytes from database and write in Webpage
                        Response.ContentType = "application/pdf";
                        Response.BinaryWrite(b);
                    }
                    else
                    {
                        // ltl.Text = "<table><tr><td style='width=500px'>";
                        foreach (DataRow drChapterName in dtChapterName.Rows)
                        {
                            string aChapter = drChapterName["ChapterName"].ToString().Trim();
                            if (chapter.Trim().Equals(aChapter))
                            {
                                ltl.Text = Convert.ToString(drChapterName["Data"]);
                            }
                        }
                    }
                }
            }
        }