public void ShowCustTaxStatement()
        {
            _branchId = GlobalVariableBO._branchId;
            _fromDate = Convert.ToDateTime(dtFromDate.Value.ToShortDateString());
            _toDate   = Convert.ToDateTime(dtToDate.Value.ToShortDateString());
            _custCode = txtCustCode.Text;

            TaxBAL          taxBal          = new TaxBAL();
            DataTable       data            = new DataTable();
            DataTable       DepositWithdraw = new DataTable();
            TaxStatementBAL TaxStatementBAL = new TaxStatementBAL();
            DataSet         TaxDataSet      = new DataSet();

            TaxDataSet = TaxStatementBAL.GetData(_custCode, _fromDate, _toDate);

            data            = taxBal.GetTaxStatement(_custCode, _fromDate, _toDate);
            DepositWithdraw = taxBal.GetDepositWithdrawBalence(_custCode, _fromDate, _toDate);

            //////// Code for Additional Share ****************//////
            cr_additionalShare cradditionalShare = new cr_additionalShare();
            DataTable          dtAdditionalShare = new DataTable();

            dtAdditionalShare = taxBal.GetAdditiobnalShare(_custCode, _fromDate, _toDate);
            // cradditionalShare.SetDataSource(dtAdditionalShare);
            //////// End ****************///////////////////////


            TaxCerfificateForm taxCerfificateForm = new TaxCerfificateForm();
            cr_TaxStatement    taxStatement       = new cr_TaxStatement();

            taxStatement.SetDataSource(data);
            taxStatement.Subreports[0].SetDataSource(dtAdditionalShare);
            taxCerfificateForm.crTaxCer.ReportSource = taxStatement;

            GetCommonInfo();
            ((TextObject)taxStatement.ReportDefinition.Sections[2].ReportObjects["txtCompanyName"]).Text = _CommpanyName;
            ((TextObject)taxStatement.ReportDefinition.Sections[2].ReportObjects["txtAddress"]).Text     = "Branch Name:" + _branchName + "," + _branchAddress + ". Phone:" + _branchContactNumber;

            ((TextObject)taxStatement.ReportDefinition.Sections[2].ReportObjects["txtFromDate"]).Text   = dtFromDate.Value.ToString("dd-MM-yyyy") + " To " + dtToDate.Value.ToString("dd-MM-yyyy");
            ((TextObject)taxStatement.ReportDefinition.Sections[2].ReportObjects["txtClientCode"]).Text = txtCustCode.Text;
            ((TextObject)taxStatement.ReportDefinition.Sections[2].ReportObjects["txtBoid"]).Text       = txtAccountHolderBOId.Text;
            ((TextObject)taxStatement.ReportDefinition.Sections[2].ReportObjects["txtClientName"]).Text = txtAccountHolderName.Text;
            ((TextObject)taxStatement.ReportDefinition.Sections[2].ReportObjects["txtSummary"]).Text    = "Summary(" + dtFromDate.Value.ToString("dd-MM-yyyy") + " To " + dtToDate.Value.ToString("dd-MM-yyyy") + ")";

            ((TextObject)taxStatement.ReportDefinition.Sections[2].ReportObjects["txtDeposit"]).Text  = DepositWithdraw.Rows[0][0].ToString();
            ((TextObject)taxStatement.ReportDefinition.Sections[2].ReportObjects["txtWithdraw"]).Text = DepositWithdraw.Rows[0][1].ToString();

            if (TaxDataSet.Tables.Count > 2)
            {
                ((TextObject)taxStatement.ReportDefinition.Sections[2].ReportObjects["txtSold_Cost_Total"]).Text       = TaxDataSet.Tables[2].Rows[0][1].ToString(); // DepositWithdraw.Rows[0][0].ToString();
                ((TextObject)taxStatement.ReportDefinition.Sections[2].ReportObjects["txtRealised_Gain_Total"]).Text   = TaxDataSet.Tables[2].Rows[0][3].ToString(); // DepositWithdraw.Rows[0][1].ToString();
                ((TextObject)taxStatement.ReportDefinition.Sections[2].ReportObjects["txtUnrealised_Gain_Total"]).Text = TaxDataSet.Tables[2].Rows[0][4].ToString(); //DepositWithdraw.Rows[0][1].ToString();
            }

            taxCerfificateForm.Text = "Tax Statement";
            taxCerfificateForm.Show();
        }
        public void ShowCustMoneyLedgerReport()
        {
            _branchId = GlobalVariableBO._branchId;
            _fromDate = Convert.ToDateTime(dtFromDate.Value.ToShortDateString());
            _toDate   = Convert.ToDateTime(dtToDate.Value.ToShortDateString());
            _custCode = txtCustCode.Text;

            TaxBAL    taxBal = new TaxBAL();
            DataTable data   = new DataTable();

            data = taxBal.GetCustSummery(_custCode, _fromDate, _toDate);

            TaxStatementBAL TaxStatementBAL = new TaxStatementBAL();
            DataSet         TaxDataSet      = new DataSet();

            TaxDataSet = TaxStatementBAL.GetData(_custCode, _fromDate, _toDate);

            TaxCerfificateForm taxCerfificateForm = new TaxCerfificateForm();
            TaxCertificate     taxCertificate     = new TaxCertificate();

            if (TaxDataSet.Tables.Count > 2)
            {
                ((TextObject)taxCertificate.ReportDefinition.Sections[2].ReportObjects["txtCurrent_Brought_Cost_Total"]).Text = String.Format("{0:#,###0.00}", Convert.ToDouble(TaxDataSet.Tables[2].Rows[0][0])); // DepositWithdraw.Rows[0][0].ToString();
                ((TextObject)taxCertificate.ReportDefinition.Sections[2].ReportObjects["txtRealised_Gain_Total"]).Text        = String.Format("{0:#,###0.00}", Convert.ToDouble(TaxDataSet.Tables[2].Rows[0][3])); // DepositWithdraw.Rows[0][1].ToString();
                ((TextObject)taxCertificate.ReportDefinition.Sections[2].ReportObjects["txtUnrealised_Gain_Total"]).Text      = String.Format("{0:#,###0.00}", Convert.ToDouble(TaxDataSet.Tables[2].Rows[0][4])); //DepositWithdraw.Rows[0][1].ToString();
                ((TextObject)taxCertificate.ReportDefinition.Sections[2].ReportObjects["Market_Value_Total"]).Text            = String.Format("{0:#,###0.00}", Convert.ToDouble(TaxDataSet.Tables[2].Rows[0][2])); //DepositWithdraw.Rows[0][1].ToString();
            }

            taxCertificate.SetDataSource(data);

            //if (TaxDataSet.Tables.Count == 3)
            //{

            //    ((TextObject)taxStatement.ReportDefinition.Sections[2].ReportObjects["txtSold_Cost_Total"]).Text = TaxDataSet.Tables[2].Rows[0][1].ToString();// DepositWithdraw.Rows[0][0].ToString();
            //    ((TextObject)taxStatement.ReportDefinition.Sections[2].ReportObjects["txtRealised_Gain_Total"]).Text = TaxDataSet.Tables[2].Rows[0][3].ToString();// DepositWithdraw.Rows[0][1].ToString();
            //    ((TextObject)taxStatement.ReportDefinition.Sections[2].ReportObjects["txtUnrealised_Gain_Total"]).Text = TaxDataSet.Tables[2].Rows[0][4].ToString();//DepositWithdraw.Rows[0][1].ToString();
            //}

            taxCerfificateForm.crTaxCer.ReportSource = taxCertificate;
            taxCerfificateForm.Show();
        }