/// <summary>
        /// Init_pages this instance.
        /// </summary>
        private void Init_page()
        {
            try
            {
                IBilling  BManager = (IBilling)ObjectFactory.CreateInstance("BusinessProcess.SCM.BBilling, BusinessProcess.SCM");
                DataTable dtBill   = BManager.GetBillDetails(this.BillID);
                lblTotalBill.InnerText = dtBill.Rows[0]["BillAmount"].ToString();
                this.AmountDue         = Convert.ToDecimal(dtBill.Rows[0]["UnpaidAmount"].ToString());
                if (this.AmountDue == 0)
                {
                    string theUrl = "./frmBillingFindAddBill.aspx";
                    Response.Redirect(theUrl, false);
                }
                this.BillAmount          = Convert.ToDecimal(dtBill.Rows[0]["BillAmount"].ToString());
                labelAmountDue.InnerText = textAmountToPay.Text = this.AmountDue.ToString();

                this.rgAmountToPay.MaximumValue = this.AmountDue.ToString();
                this.rgAmountToPay.MinimumValue = "0";
                this.rgAmountToPay.ErrorMessage = string.Format("The value should be between 0 and {0}", this.AmountDue);
                this.PopulateBillItems();
                this.PopulateBillTransactions();
                this.PopulatePaymentMode();
                this.PopulatePatientDetails();
                tblCompute.Visible = true;

                tblFinish.Visible     = false;
                buttonCompute.Enabled = false;
            }
            catch (Exception ex)
            {
                this.showErrorMessage(ref ex);
            }
        }
        /// <summary>
        /// Init_pages this instance.
        /// </summary>
        private void Init_page()
        {
            try
            {
                IBilling  BManager = (IBilling)ObjectFactory.CreateInstance("BusinessProcess.SCM.BBilling, BusinessProcess.SCM");
                DataTable dtBill   = BManager.GetBillDetails(this.BillID);
                // lblTotalBill.InnerText = dtBill.Rows[0]["BillAmount"].ToString();
                this.AmountDue = Convert.ToDecimal(dtBill.Rows[0]["UnpaidAmount"].ToString());

                bool hasTransaction = Convert.ToBoolean(dtBill.Rows[0]["HasTransaction"]);
                this.HasTransaction = hasTransaction;
                this.BillPayOption  = (BillPaymentOptions)Convert.ToInt32(dtBill.Rows[0]["PayMode"].ToString());

                labelBillNumber.Text = this.BillNumber = dtBill.Rows[0]["BillNumber"].ToString();
                HLocationID.Value    = dtBill.Rows[0]["LocationID"].ToString();
                if (this.AmountDue == 0)
                {
                    //string theUrl = "./frmBillingFindAddBill.aspx";
                    //Response.Redirect(theUrl, false);
                }
                buttonProceed.Enabled = this.AmountDue > 0;
                this.BillAmount       = Convert.ToDecimal(dtBill.Rows[0]["BillAmount"].ToString());
                // labelAmountOutstanding.Text = labelAmountDue.InnerText = textAmountToPay.Text = this.AmountDue.ToString();
                labelAmountDue.Text = this.AmountDue.ToString();
                // this.rgAmountToPay.MaximumValue = this.AmountDue.ToString();
                //  this.rgAmountToPay.MinimumValue = "0";
                // this.rgAmountToPay.ErrorMessage = string.Format("The value should be between 0 and {0}", this.AmountDue);
                this.PopulateBillItems();
                if (hasTransaction)
                {
                    this.PopulateBillTransactions();
                }
                this.PopulatePaymentMode();
                // tblCompute.Visible = true;
                //    panelCompute.Visible = true;
                //tblFinish.Visible = false;
                //    panelFinish.Visible = false;

                this.PopulatePatientDetails();
                HDisplay.Value       = "ITEMS";
                panelPayment.Visible = false;
            }
            catch (Exception ex)
            {
                this.showErrorMessage(ref ex);
            }
        }