private void PopulateHeaderGrid()
        {
            int    CompanyId   = Convert.ToInt32(Session["CompanyId"].ToString().Trim());
            int    FinYrID     = Convert.ToInt32(Session["FinYrID"].ToString().Trim());
            int    BranchId    = Convert.ToInt32(Session["BranchId"].ToString().Trim());
            string DNVoucherNo = txtVchNoSearch.Text.Trim();
            string FromDate    = txtVchDateSearch.Text.Trim();
            string ToDate      = txtVchDateSearchTo.Text.Trim();

            BusinessLayer.Accounts.TrnDebitNoteHeader objDebitNote = new TrnDebitNoteHeader();
            DataTable DT = objDebitNote.GetAll(CompanyId, FinYrID, BranchId, DNVoucherNo, FromDate, ToDate);

            if (DT != null)
            {
                dgvDebitNote.DataSource = DT;
                dgvDebitNote.DataBind();
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            clsGeneralFunctions gf = new clsGeneralFunctions();
            char   chr             = Convert.ToChar(130);
            string strValues       = "";

            if (!IsPostBack)
            {
                if (Request.QueryString["id"] != null && Request.QueryString["id"].Trim().Length > 0)
                {
                    BusinessLayer.Accounts.TrnDebitNoteHeader ObjTrnDebitNoteHeader = new TrnDebitNoteHeader();
                    int intID = Convert.ToInt32(Request.QueryString["id"].Trim());
                    strValues  = Session["CompanyID"].ToString();
                    strValues += chr.ToString() + intID.ToString();
                    DataTable DT = ObjTrnDebitNoteHeader.GetAll(intID);
                    dgvReceipt.DataSource = DT;
                    dgvReceipt.DataBind();
                    string CommanyId = Session["CompanyId"].ToString();
                    //LoadDetails(ds1.Tables[0]);
                    //LoadFooterRow(ds.Tables[0]);
                    LoadFooterRow(DT);
                    LoadHeader(DT);
                    LoadSignature();

                    if (CommanyId == "2")
                    {
                        img.ImageUrl = "../Images/ReportHeader.png";
                    }
                    else if (CommanyId == "4")
                    {
                        img.ImageUrl = "../Images/DiplomaHeader.jpg";
                    }
                    else if (CommanyId == "1")
                    {
                        img.ImageUrl = "../Images/Management.png";
                    }
                }
            }
        }