public void BindAgencyCloserScreenInfo()
        {
            DispatchData dispatchdata = new DispatchData();

            d = new Dispatch();
            DataSet DS = new DataSet();

            d.AgentID  = Convert.ToInt32(dpAgent.SelectedItem.Value);
            d.closedby = GlobalInfo.Userid;
            d.tokanid  = hftokanno.Value;
            DS         = dispatchdata.PrintAgencyCloserInfo(d);
            string result = string.Empty;

            if (!Comman.Comman.IsDataSetEmpty(DS))
            {
                StringBuilder sb = new StringBuilder();
                sb.Append("<style type='text / css'>");
                sb.Append(".tg  { border - collapse:collapse; border - spacing:0; border: none; }");
                sb.Append(".tg .tg-yw4l{vertical-align:top}");
                sb.Append(".tg .tg-baqh{text-align:center;vertical-align:top}");
                sb.Append("</style>");
                sb.Append("<table class='tg style1' style='page-break-inside:avoid; align:center;'>");
                sb.Append("<colgroup>");
                sb.Append("<col style = 'width:150px'>");
                sb.Append("<col style = 'width:150px'>");
                sb.Append("<col style = 'width:120px'>");
                sb.Append("<col style = 'width:120px'>");
                sb.Append("<col style = 'width:100px'>");

                sb.Append("</colgroup>");

                sb.Append("<tr>");
                sb.Append("<th class='tg-yw4l' rowspan='2'>");
                sb.Append("<img src='/Theme/img/logo1.png' class='img-circle' alt='Logo' width='50px' hight='50px'>");
                sb.Append("</th>");

                sb.Append("<th class='tg-baqh' colspan='2' style='text-align:center; font-size: 80%;'>");
                sb.Append("<u> Agency Closer Bill  </u> <br/>");
                sb.Append("</th>");

                sb.Append("<th class='tg-yw4l' colspan='2' style='text-align:right; font-size: 80%;'>");

                sb.Append("TIN:330761667331<br>");
                sb.Append("</th>");
                sb.Append("</tr>");
                sb.Append("<tr style='border-bottom:1px solid'>");
                sb.Append("<td class='tg-yw4l' colspan='4' style='text-align:Left'>");
                sb.Append("<b>Nanjil Integrated Dairy Development, Mulagumoodu, K.K.Dt.  Ph:248370, 248605</b>");

                sb.Append("</td>");
                sb.Append("</tr>");

                sb.Append("<tr style='border-bottom:1px solid'>");
                sb.Append("<td colspan ='2' style='text-align:left; font-size: 80%;'>");
                sb.Append("Agency Closer");
                sb.Append("</td>");

                sb.Append("<td>");
                sb.Append("&nbsp;");
                sb.Append("</td>");
                sb.Append("<td colspan='2' style='text-align:right; font-size: 80%;'>");
                sb.Append("Agency Closer No ");
                sb.Append("</td>");

                sb.Append("</tr>");

                sb.Append("<tr style='border-bottom:1px solid'>");
                sb.Append("<td colspan ='2' style='text-align:left; font-size: 80%;'>");
                sb.Append(DateTime.Now.ToString());
                sb.Append("</td>");

                sb.Append("<td>");
                sb.Append("&nbsp;");
                sb.Append("</td>");
                sb.Append("<td colspan='2' style='text-align:right; font-size: 80%;'>");
                sb.Append("<b>" + DS.Tables[0].Rows[0]["id"] + "</b>");
                sb.Append("</td>");

                sb.Append("</tr>");

                //sb.Append("<tr style='border-bottom:1px solid'> <td colspan = '5'> &nbsp; </td> </tr>");
                sb.Append("<tr style='border-bottom:0.5px solid'>");



                sb.Append("<td colspan='2'>");

                sb.Append("Route" + "&nbsp;" + "<b>" + DS.Tables[0].Rows[0]["Route"] + "</b>");

                sb.Append("</td>");

                sb.Append("<td colspan='3'>");

                sb.Append("Agent" + "&nbsp;" + "<b>" + DS.Tables[0].Rows[0]["Agent"] + "</b>");

                sb.Append("</td>");
                sb.Append("</tr>");



                sb.Append("<tr>");
                sb.Append("<td style='text-align:left'>");
                sb.Append("<u>" + "Payment Details :" + "</u>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td  style='text-align:left'>");
                string loanpaid = string.Empty;
                if (DS.Tables[0].Rows[0]["loanpaid"].ToString() == "True")
                {
                    loanpaid = "Yes";
                }
                else
                {
                    loanpaid = "No";
                }
                sb.Append("Loan Paid :" + "&nbsp;" + "<b>" + loanpaid + "</b>");

                sb.Append("</td>");
                sb.Append("<td colspan='2' style='text-align:left'>");
                string schemepaid = string.Empty;
                if (DS.Tables[0].Rows[0]["schemepaid"].ToString() == "True")
                {
                    schemepaid = "Yes";
                }
                else
                {
                    schemepaid = "No";
                }
                sb.Append("Scheme Paid :" + "&nbsp;" + "<b>" + schemepaid + "</b>");


                sb.Append("</td>");
                sb.Append("<td colspan='2' style='text-align:left'>");
                string incentivepaid = string.Empty;
                if (DS.Tables[0].Rows[0]["incentivepaid"].ToString() == "True")
                {
                    incentivepaid = "Yes";
                }
                else
                {
                    incentivepaid = "No";
                }
                sb.Append("IncentivePaid:" + "&nbsp;" + "<b>" + incentivepaid + "</b>");

                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td  style='text-align:left'>");
                string depositrefund = string.Empty;
                if (DS.Tables[0].Rows[0]["depositrefund"].ToString() == "True")
                {
                    depositrefund = "Yes";
                }
                else
                {
                    depositrefund = "No";
                }
                sb.Append("Deposit Refund :" + "&nbsp;" + "<b>" + depositrefund + "</b>");

                sb.Append("</td>");


                sb.Append("</tr>");

                sb.Append("<tr>");
                sb.Append("<td style='text-align:left'>");
                sb.Append("<u>" + "Item Returns :" + "</u>");
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("<tr>");
                sb.Append("<td  style='text-align:left'>");
                string freezerreturn = string.Empty;
                if (DS.Tables[0].Rows[0]["freezerreturn"].ToString() == "True")
                {
                    freezerreturn = "Yes";
                }
                else
                {
                    freezerreturn = "No";
                }
                sb.Append("Freezer:" + "&nbsp;" + "<b>" + freezerreturn + "</b>");

                sb.Append("</td>");
                sb.Append("<td style='text-align:left'>");
                string chillpaid = string.Empty;
                if (DS.Tables[0].Rows[0]["chillpaid"].ToString() == "True")
                {
                    chillpaid = "Yes";
                }
                else
                {
                    chillpaid = "No";
                }
                sb.Append("Chillpad :" + "&nbsp;" + "<b>" + chillpaid + "</b>");


                sb.Append("</td>");
                sb.Append("<td  style='text-align:left'>");
                string trays = string.Empty;
                if (DS.Tables[0].Rows[0]["trays"].ToString() == "True")
                {
                    trays = "Yes";
                }
                else
                {
                    trays = "No";
                }
                sb.Append("Trays:" + "&nbsp;" + "<b>" + trays + "</b>");

                sb.Append("</td>");



                sb.Append("</tr>");
                sb.Append("<tr style='border-bottom:0.5px solid'><td colspan='5'></td></tr>");
                sb.Append("<tr style='border-bottom:0.5px solid'>");
                sb.Append("<td colspan='5'> ");
                sb.Append("Approved By: " + "<b>" + DS.Tables[0].Rows[0]["Name"] + "</b>");
                sb.Append("</td> ");
                sb.Append("</tr>");



                result            = sb.ToString();
                genratedBIll.Text = result;
                //Session["ctrl"] = sb.ToString();
                Session["ctrl"] = pnlBills;
                //Response.Redirect("/print.aspx", true);
            }
            else
            {
                //result = "No Records Found";
                //genratedBIll.Text = result;
            }
        }