protected void Page_Load(object sender, EventArgs e)
    {
        ListItem LItem = new ListItem("--Select--", "0");
        ddlPaymetMode.Items.Insert(0, LItem);
        
        LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
        LoanDS.LoanApplicationsDataTable tblLoanApp = loanApp.GetLoanApplication(MySessionManager.AppID.ToString());
        txtBranch.InnerText = util.displayValue("tbl_teams", loanApp.GetLoanAppBranch(MySessionManager.AppID, MySessionManager.ClientID).ToString());
        if (tblLoanApp.Rows.Count > 0)
        {
            this.lblTotalAmt.InnerText = tblLoanApp[0].datDisburseAmount.ToString("c").Replace("$","");
            this.txtDate.Text = DateTime.Now.ToString("dd-MM-yyyy");
        }
        if (!(this.editskip1.Value == "2"))
        {
            txtVoucherNo.Value = getPVNo();
            loadfv();

            txtTotalAmount.Text = sumAmount().ToString();
            txtAmtWords.Value = NTE.changeNumericToWords(Convert.ToDouble(sumAmount())) + "Ghana Cedis ";
        }
        if (!(Request.QueryString["pvedit"] == null))
        {
            type = "update";
            id = Convert.ToInt32(Request.QueryString["pvedit"]);
            if (!(this.editskip.Value == "2"))
            {
                //txtVoucherNo.Value = getPVNo();
                loadpv(id);
            }
        }
        else if (!(Request.QueryString["pvdelete"] == null))
        {
            try
            {
                string id = Request.QueryString["pvdelete"];
                util.deleteItem("tbl_payment_vouchers", id);

                Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "pvdelete"));
            }
            catch
            { }
        }


    }
    protected void Page_Load(object sender, EventArgs e)
    {
        ListItem LItem = new ListItem("--Select--", "0");

        ddlPaymetMode.Items.Insert(0, LItem);

        LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
        LoanDS.LoanApplicationsDataTable tblLoanApp = loanApp.GetLoanApplication(MySessionManager.AppID.ToString());
        txtBranch.InnerText = util.displayValue("tbl_teams", loanApp.GetLoanAppBranch(MySessionManager.AppID, MySessionManager.ClientID).ToString());
        if (tblLoanApp.Rows.Count > 0)
        {
            this.lblTotalAmt.InnerText = tblLoanApp[0].datDisburseAmount.ToString("c").Replace("$", "");
            this.txtDate.Text          = DateTime.Now.ToString("dd-MM-yyyy");
        }
        if (!(this.editskip1.Value == "2"))
        {
            txtVoucherNo.Value = getPVNo();
            loadfv();

            txtTotalAmount.Text = sumAmount().ToString();
            txtAmtWords.Value   = NTE.changeNumericToWords(Convert.ToDouble(sumAmount())) + "Ghana Cedis ";
        }
        if (!(Request.QueryString["pvedit"] == null))
        {
            type = "update";
            id   = Convert.ToInt32(Request.QueryString["pvedit"]);
            if (!(this.editskip.Value == "2"))
            {
                //txtVoucherNo.Value = getPVNo();
                loadpv(id);
            }
        }
        else if (!(Request.QueryString["pvdelete"] == null))
        {
            try
            {
                string id = Request.QueryString["pvdelete"];
                util.deleteItem("tbl_payment_vouchers", id);

                Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "pvdelete"));
            }
            catch
            { }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
      
        LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
        LoanDS.LoanApplicationsDataTable tblLoanApp = loanApp.GetLoanApplication(MySessionManager.AppID.ToString());
        lblbranch.InnerText = util.displayValue("tbl_teams", loanApp.GetLoanAppBranch(MySessionManager.AppID, MySessionManager.ClientID).ToString());
        mTempTableAdapters.GetTransactionDetailsTableAdapter tempHolder = new mTempTableAdapters.GetTransactionDetailsTableAdapter();
        try
        { lblTotal.Text = tempHolder.GetTransTotalAmount(MySessionManager.AppID).ToString(); }
        catch (Exception ex)
        {
            lblTotal.Text = "0.00";
        }
        
        if (tblLoanApp.Rows.Count > 0)
        {
            mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
            lbltotalamt.InnerText = tblLoanApp[0].datLoanAmount.ToString("c").Replace("$", "");
            lbldate.InnerText = DateTime.Now.ToLongDateString();
            lblClient.InnerText = client.GetClientsName(MySessionManager.ClientID).ToString();
        
        }

        if (!(this.editskip.Value =="2"))
        {

        }
        if (!(Request.QueryString["trdelete"] == null))
        {
            try
            {
                string id = Request.QueryString["trdelete"];
                tempHolder.DeleteTransactionDetails(Convert.ToInt32(id), MySessionManager.AppID);

                Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "trdelete"));
            }
            catch
            { }
        }
        
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        LoanDSTableAdapters.LoanApplicationsTableAdapter loanApp = new LoanDSTableAdapters.LoanApplicationsTableAdapter();
        LoanDS.LoanApplicationsDataTable tblLoanApp = loanApp.GetLoanApplication(MySessionManager.AppID.ToString());
        lblbranch.InnerText = util.displayValue("tbl_teams", loanApp.GetLoanAppBranch(MySessionManager.AppID, MySessionManager.ClientID).ToString());
        mTempTableAdapters.GetTransactionDetailsTableAdapter tempHolder = new mTempTableAdapters.GetTransactionDetailsTableAdapter();
        try
        { lblTotal.Text = tempHolder.GetTransTotalAmount(MySessionManager.AppID).ToString(); }
        catch (Exception ex)
        {
            lblTotal.Text = "0.00";
        }

        if (tblLoanApp.Rows.Count > 0)
        {
            mainDSTableAdapters.ClientTableAdapter client = new mainDSTableAdapters.ClientTableAdapter();
            lbltotalamt.InnerText = tblLoanApp[0].datLoanAmount.ToString("c").Replace("$", "");
            lbldate.InnerText     = DateTime.Now.ToLongDateString();
            lblClient.InnerText   = client.GetClientsName(MySessionManager.ClientID).ToString();
        }

        if (!(this.editskip.Value == "2"))
        {
        }
        if (!(Request.QueryString["trdelete"] == null))
        {
            try
            {
                string id = Request.QueryString["trdelete"];
                tempHolder.DeleteTransactionDetails(Convert.ToInt32(id), MySessionManager.AppID);

                Page.Response.Redirect(util.RemoveQueryStringByKey(HttpContext.Current.Request.Url.AbsoluteUri, "trdelete"));
            }
            catch
            { }
        }
    }