Esempio n. 1
0
        void bttnUpdate_Click(object sender, EventArgs e)
        {
            DataRowView oDataRowView = cboBatch.SelectedItem as DataRowView;

            if (radioGroup1.SelectedIndex == -1)
            {
                Common.setEmptyField("IGR Report Options...", Program.ApplicationName);
                return;
            }
            else
            {
                try
                {
                    SplashScreenManager.ShowForm(this, typeof(WaitForm1), true, true, false);

                    if (oDataRowView != null)
                    {
                        if (radioGroup1.EditValue == "Bank")//Call Report for bank Reconciliation
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Bank";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;
                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        XtraRepGen report = new XtraRepGen();
                                        report.xrLabel18.Text = String.Format(" for the month of : [{0}]", oDataRowView.Row["BatchName"]);
                                        report.DataSource     = ds.Tables[1];
                                        report.DataMember     = "table";
                                        report.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                        else if (radioGroup1.EditValue == "Agency")
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Agency";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;
                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        XtraRepSummrayAgency repAgency = new XtraRepSummrayAgency()
                                        {
                                            DataSource = ds, DataMember = "table"
                                        };
                                        repAgency.xrLabel32.Text = string.Format(" {0} STATE GOVERNMENT ", Program.StateName.ToUpper());

                                        repAgency.xrLabel33.Text = string.Format("Summary of Collection by Agencies for the Month of  {0}", oDataRowView.Row["BatchName"]);
                                        repAgency.DataSource     = ds.Tables[1];
                                        repAgency.DataMember     = "ViewReconciliationAgencyDetails";
                                        repAgency.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                        else if (radioGroup1.EditValue == "Revenue")
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Revenue";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;
                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        XtraRepSummRevenue report = new XtraRepSummRevenue()
                                        {
                                            DataSource = ds.Tables[1], DataMember = "table"
                                        };
                                        //report.paramMonths.Value = dtpStart.Value.Month;
                                        //report.paramYear.Value = dtpStart.Value.Year;

                                        report.xrLabel32.Text = string.Format(" {0} STATE GOVERNMENT ", Program.StateName.ToUpper());

                                        report.xrLabel33.Text = string.Format("Summary of Collection by Revenue Type for the Month of  {0}", oDataRowView.Row["BatchName"]);

                                        report.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                        else if (radioGroup1.EditValue == "Details")
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Details";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;
                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        XtraRepAgencyDetails report = new XtraRepAgencyDetails();

                                        report.xrLabel32.Text = string.Format(" {0} STATE GOVERNMENT ", Program.StateName.ToUpper());
                                        report.xrLabel33.Text = string.Format("Summary of Collection by Agencies Details for the Month of  {0}", oDataRowView.Row["BatchName"]);

                                        //report.paramMonths.Value = dtpStart.Value.Month;
                                        //report.paramYears.Value = dtpStart.Value.Year;
                                        report.DataSource = ds.Tables[1];
                                        report.DataMember = "ViewReconciliationAgencyDetails";
                                        //report.DataAdapter
                                        report.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                        else if (radioGroup1.EditValue == "Account")
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Account";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;
                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        //XtraRepIGRSummary repsumary = new XtraRepIGRSummary();

                                        XtraRepIGRAccounts repacct = new XtraRepIGRAccounts();

                                        //repsumary.xrLabel13.Text = string.Format("{0} State Government", Program.StateName);

                                        //repsumary.xrLabel14.Text = string.Format("Summary of {0} State Government IGR Accounts for {1}", Program.StateName, oDataRowView.Row["BatchName"]);

                                        repacct.xrLabel27.Text = string.Format(" {0} STATE GOVERNMENT ", Program.StateName.ToUpper());

                                        repacct.xrLabel28.Text = string.Format(" DETAILS OF TRANSFER / CHARGES FOR {0}", oDataRowView.Row["BatchName"]);

                                        repacct.DataSource = ds.Tables[1];
                                        repacct.DataMember = "table";
                                        repacct.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                        else if (radioGroup1.EditValue == "Consolidate")
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Consolidate";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;
                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        XtraRepSummary repsummary = new XtraRepSummary();
                                        repsummary.xrLabel32.Text = string.Format("{0} STATE GOVERNMENT ", Program.StateName.ToUpper());
                                        repsummary.xrLabel33.Text = string.Format("CONSOLIDATED SUMMARY ACCOUNT OF IGR FOR THE MONTH OF {0}", oDataRowView.Row["BatchName"]);

                                        repsummary.DataSource = ds.Tables[1];

                                        repsummary.DataMember = "ViewConsolidateDetailsTransactions";

                                        //repsummary.paramPeriod.Value = dtpStart.Value.Month;
                                        //repsummary.paramYear.Value = dtpStart.Value.Year;
                                        repsummary.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                        else if (radioGroup1.EditValue == "Bank Details")
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Bank Details";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;
                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        XtraRepBankDetails bankdetails = new XtraRepBankDetails();

                                        var list = (from DataRow row in ds.Tables[1].Rows
                                                    select new Dataset.BankDetails
                                        {
                                            Amount = Convert.ToDecimal(row["Amount"]),
                                            PaymentDate = Convert.ToDateTime(row["PaymentDate"]),
                                            BankName = row["BankName"] as string,
                                            BankCode = row["BankCode"] as string,
                                            Description = row["Description"] as string,
                                            PayerName = row["PayerName"] as string,
                                            RevenueCode = row["RevenueCode"] as string,
                                            AccountNumber = row["AccountNumber"] as string,

                                            //Branchname = row["Branchname"] as string
                                        }
                                                    ).ToList();

                                        bankdetails.xrLabel17.Text = string.Format("{0} State Government", Program.StateName);

                                        bankdetails.xrLabel18.Text = string.Format("Bank Details of {0} State Government IGR Accounts for {1}", Program.StateName, oDataRowView.Row["BatchName"]);

                                        //bankdetails.DataSource = ds.Tables[1];
                                        //bankdetails.DataMember = "table";

                                        var binding = (BindingSource)bankdetails.DataSource;

                                        binding.Clear();

                                        binding.DataSource = list;

                                        bankdetails.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                        else if (radioGroup1.EditValue == "Summary")
                        {
                            using (SqlConnection connect = new SqlConnection(Logic.ConnectionString))
                            {
                                connect.Open();
                                _command = new SqlCommand("doIGRReport", connect)
                                {
                                    CommandType = CommandType.StoredProcedure
                                };
                                _command.Parameters.Add(new SqlParameter("@Type", SqlDbType.VarChar)).Value      = "Summary";
                                _command.Parameters.Add(new SqlParameter("@BatchCode", SqlDbType.VarChar)).Value = oDataRowView.Row["BatchCode"];
                                _command.CommandTimeout = 0;

                                using (System.Data.DataSet ds = new System.Data.DataSet())
                                {
                                    ds.Clear();
                                    adp = new SqlDataAdapter(_command);
                                    adp.Fill(ds);
                                    connect.Close();

                                    if (ds.Tables[0].Rows[0]["returnCode"].ToString() == "00")
                                    {
                                        XtraRepIGRSummary repsumary = new XtraRepIGRSummary();

                                        repsumary.xrLabel13.Text = string.Format("{0} State Government", Program.StateName);

                                        repsumary.xrLabel14.Text = string.Format("Summary of {0} State Government IGR Accounts for {1}", Program.StateName, oDataRowView.Row["BatchName"]);
                                        repsumary.DataSource     = ds.Tables[1];
                                        repsumary.DataMember     = "table";
                                        repsumary.ShowPreviewDialog();
                                    }
                                    else
                                    {
                                        return;
                                    }
                                }
                            }
                        }
                    }
                    else
                    {
                    }
                }
                catch (Exception ex)
                {
                    Tripous.Sys.ErrorBox(ex);
                }
                finally
                {
                    SplashScreenManager.CloseForm(false);
                }
            }
        }
Esempio n. 2
0
        void bttnUpdate_Click(object sender, EventArgs e)
        {
            var dtf = CultureInfo.CurrentCulture.DateTimeFormat;


            if (radioGroup1.SelectedIndex == -1)
            {
                Common.setEmptyField(" IGR Report Options...", Program.ApplicationName);
                return;
            }
            else
            {
                GetStateRefer();

                //strperiod = String.Format("{0}/{1}", cboPeriods.SelectedValue, cboYears.SelectedValue);

                GetPeriodCollection(strperiod);

                #region

                //// get month string
                //strmonth = cboPeriods.Text.Substring(0, 2);

                //split = cboPeriods.Text.Trim().Split(new Char[] { '/' });

                //var dtf = CultureInfo.CurrentCulture.DateTimeFormat;

                //var month = Convert.ToInt32(cboPeriods.Text.Substring(0, 2));

                //var fyear = cboPeriods.Text.Length;

                //monthName = dtf.GetMonthName(month);
                #endregion

                if (radioGroup1.EditValue == "Bank")//Call Report for bank Reconciliation
                {
                    //string fulltext = String.Format(" for the month of : [{0} {1}]", cboPeriods.Text, cboYears.SelectedValue);

                    //XtraRepGeneral reports = new XtraRepGeneral();

                    //reports.xrLabel18.Text = fulltext;

                    //reports.parmPeriod.Value = cboPeriods.SelectedValue;

                    //reports.paramYear.Value = cboYears.SelectedValue;

                    //reports.ShowPreviewDialog();
                    DataSet dataSet1 = new DataSet();

                    string query = string.Format("SELECT Description, BankName, AccountNo, OpenBal, CloseBal, Dr, Cr, AccountName, BranchName, BankShortCode, StartDate, EndDate FROM ViewTransactionBankAccount WHERE CONVERT(VARCHAR(10),StartDate,103)='{0}' AND CONVERT(VARCHAR(10),EndDate,103)='{1}'", string.Format("{0:dd/MM/yyy}", dtpStart.Value), string.Format("{0:dd/MM/yyy}", dtpEnd.Value));

                    using (SqlDataAdapter ada = new SqlDataAdapter((string)query, Logic.ConnectionString))
                    {
                        ada.Fill(dataSet1, "table");
                    }

                    if (dataSet1.Tables[0].Rows.Count == 0)
                    {
                        Common.setMessageBox("No Record For This Report ", Program.ApplicationName, 1);
                        return;
                    }
                    else
                    {
                        XtraRepGen report = new XtraRepGen();
                        report.xrLabel18.Text = String.Format(" for the month of : [{0} {1}]", dtpStart.Value.Month, dtpStart.Value.Year);
                        //report.paramPeriod.Value = dtpStart.Value.Month;
                        //report.paramYear.Value = dtpStart.Value.Year;
                        report.DataSource = dataSet1;
                        report.DataMember = "table";
                        report.ShowPreviewDialog();
                    }
                }
                else if (radioGroup1.EditValue == "Payment")//Call Report for IGR Payment
                {
                    //strbdate, stredate;
                    XtraRepIGRPay repigrpay = new XtraRepIGRPay();

                    repigrpay.xrLabel24.Text = string.Format("{0:dd MMMM, yyyy}", DateTime.Now);

                    repigrpay.xrLabel5.Text = string.Format("Please refer to your letters referenced: {0} dated {1}", strRef, string.Format("{0:dd MMMM yyyy}", dtbdate));
                    //, string.Format("{0:dd MMMM yyyy}", dtedate)
                    repigrpay.xrLabel4.Text = string.Format("REQUEST FOR THE PAYMENT OF OUR {0} FEE", dtf.GetMonthName(dtpStart.Value.Month));

                    repigrpay.xrLabel6.Text = string.Format("We hereby request you to pay our fee for the month of {0}, {1} computed as follows:", dtf.GetMonthName(dtpStart.Value.Month), dtpStart.Value.Year);

                    repigrpay.xrTableCell4.Text = string.Format("Gross Collection monitored for the month of {0},{1}", dtf.GetMonthName(dtpStart.Value.Month), dtpStart.Value.Year);

                    repigrpay.xrTableCell5.Text = string.Format("{0:n2}", dbCollect);

                    repigrpay.xrTableCell15.Text = "180,000,000.00";

                    repigrpay.xrTableCell6.Text = string.Format("Incremental Collection for the month of {0},{1}", dtf.GetMonthName(dtpStart.Value.Month), dtpStart.Value.Year);

                    double dbt = Convert.ToDouble(dbCollect - 180000000); //incremental collection

                    repigrpay.xrTableCell7.Text = string.Format("{0:n2}", dbt);

                    double dbfeepay = Convert.ToDouble((15 / 100) * dbt);

                    repigrpay.xrTableCell9.Text = string.Format("{0:n2}", dbfeepay);

                    double dbvatadd = Convert.ToDouble((5 / 100) * dbfeepay);

                    repigrpay.xrTableCell11.Text = string.Format("{0:n2}", dbvatadd);

                    double dbgrossfee = Convert.ToDouble(dbvatadd + dbfeepay);

                    repigrpay.xrTableCell19.Text = string.Format("{0:n2}", dbgrossfee);

                    //repigrpay.xrLabel9.Text = string.Format("Total IGR monitored for the month of {0},{1} computed as follows:", dtpStart.Value.Month, dtpStart.Value.Year);

                    //repigrpay.xrLabel10.Text = string.Format("{0:n2}", dbCollect);

                    //repigrpay.xrLabel12.Text = string.Format("{0:n2}", dbCollect * (dbpay / 100));

                    //repigrpay.xrLabel17.Text = string.Format("{0:n2}", (dbCollect * (dbpay / 100)) * (dbwth / 100));

                    //repigrpay.xrLabel18.Text = string.Format("{0:n2}", ((dbCollect * (dbpay / 100)) - ((dbCollect * (dbpay / 100)) * (dbwth / 100))));

                    //repigrpay.xrLabel19.Text = string.Format("{0:n2}", (((dbCollect * (dbpay / 100)) - ((dbCollect * (dbpay / 100)) * (dbwth / 100)))) * (dbvat / 100));

                    //repigrpay.xrLabel20.Text = string.Format("{0:n2}", ((dbCollect * (dbpay / 100)) - ((dbCollect * (dbpay / 100)) * (dbwth / 100))) - ((((dbCollect * (dbpay / 100)) - ((dbCollect * (dbpay / 100)) * (dbwth / 100)))) * (dbvat / 100)));

                    repigrpay.ShowPreviewDialog();
                }
                else if (radioGroup1.EditValue == "Summary")
                {
                    DataSet dataSet1 = new DataSet();

                    string query = string.Format("SELECT AccountNo, OpenBal, CloseBal, Dr, Cr, BankShortCode, BankName, StartDate, EndDate, Amount, ExAmount FROM ViewSummaryIGRAccount WHERE CONVERT(VARCHAR(10),StartDate,103)='{0}' AND CONVERT(VARCHAR(10),EndDate,103)='{1}'", string.Format("{0:dd/MM/yyy}", dtpStart.Value), string.Format("{0:dd/MM/yyy}", dtpEnd.Value));
                    using (SqlDataAdapter ada = new SqlDataAdapter((string)query, Logic.ConnectionString))
                    {
                        ada.Fill(dataSet1, "table");
                    }

                    if (dataSet1.Tables[0].Rows.Count == 0)
                    {
                        Common.setMessageBox("No Record For This Report ", Program.ApplicationName, 1);
                        return;
                    }
                    else
                    {
                        XtraRepIGRSummary repsumary = new XtraRepIGRSummary();

                        repsumary.xrLabel13.Text = string.Format("{0} State Government", Program.StateName);

                        repsumary.xrLabel14.Text = string.Format("Summary of {0} State Government IGR Accounts for {1}, {2}", Program.StateName, dtf.GetMonthName(dtpStart.Value.Month), dtpStart.Value.Year);

                        //repsumary.paramPeriod.Value = dtpStart.Value.Month;

                        //repsumary.paramYear.Value = dtpStart.Value.Year;
                        repsumary.DataSource = dataSet1;

                        repsumary.DataMember = "table";

                        repsumary.ShowPreviewDialog();
                    }
                }
                else if (radioGroup1.EditValue == "Consolidate")
                {
                    //DataSet dataSet1 = new DataSet();
                    DataSet dataSet1 = new DataSet();

                    string query = string.Format("SELECT BankShortCode, BankName, OpenBal, CloseBal, Amount, [Returned Cheque], [Transfer To Govt. Acct], [Bank Charge], [Prev Credit Reversed], [Credit Interst], [Transfer From Govt. Acct], [Prev Debit Reversed], [Returned Cheque (Prev)], [Collection Logment], Expr1, StartDate, EndDate FROM  ViewConsolidateDetailsTransactions WHERE CONVERT(VARCHAR(10),StartDate,103)='{0}' AND CONVERT(VARCHAR(10),EndDate,103)='{1}'", string.Format("{0:dd/MM/yyy}", dtpStart.Value), string.Format("{0:dd/MM/yyy}", dtpEnd.Value));
                    using (SqlDataAdapter ada = new SqlDataAdapter((string)query, Logic.ConnectionString))
                    {
                        ada.Fill(dataSet1, "table");
                    }

                    if (dataSet1.Tables[0].Rows.Count == 0)
                    {
                        Common.setMessageBox("No Record For This Report ", Program.ApplicationName, 1);
                        return;
                    }
                    else
                    {
                        XtraRepSummary repsummary = new XtraRepSummary();
                        repsummary.xrLabel32.Text = string.Format("{0} STATE GOVERNMENT ", Program.StateName.ToUpper());
                        repsummary.xrLabel33.Text = string.Format(" CONSOLIDATED SUMMARY ACCOUNT OF IGR FOR THE MONTH OF {0} , {1}", dtf.GetMonthName(dtpStart.Value.Month), dtpStart.Value.Year);

                        repsummary.DataSource = dataSet1;

                        repsummary.DataMember = "table";

                        //repsummary.paramPeriod.Value = dtpStart.Value.Month;
                        //repsummary.paramYear.Value = dtpStart.Value.Year;
                        repsummary.ShowPreviewDialog();
                    }
                }
                else if (radioGroup1.EditValue == "Account")
                {
                    #region

                    ////// Create a cross-tab report.
                    //XtraReport report = CreateReport();

                    //XRLabel label1 = new XRLabel();


                    ////call a igraccount detail report
                    ////XtraRepIGRAccount report = new XtraRepIGRAccount();

                    ////report.xrLabel13.Text = string.Format("{0} State Government", Program.StateName);

                    ////report.xrLabel14.Text = string.Format("Transfer / Charges Account Details IGR for the month of {0}, {1}", cboPeriods.Text, cboYears.SelectedValue.ToString());

                    ////report.paramPeriod.Value = cboPeriods.Text;
                    //// Show its Print Preview.

                    //report.Landscape = true;

                    //report.PaperKind = System.Drawing.Printing.PaperKind.Custom;
                    //report.PageHeight = 850;
                    //report.PageWidth = 1100;
                    //report.Margins = new System.Drawing.Printing.Margins(15, 15, 100, 100);
                    //report.VerticalContentSplitting = DevExpress.XtraPrinting.VerticalContentSplitting.Smart;

                    //report.ShowPreview();
                    #endregion

                    #region

                    //DataSet dataSet1 = new DataSet();

                    //string quy = string.Format("SELECT Period,AccountNo,OpenBal,CloseBal,TransDescription,BankName,BankShortCode,Amount,Years FROM ViewIGRAccountDetails WHERE Period='{0}' and years='{1}' ", cboPeriods.SelectedValue, cboYears.SelectedValue);

                    //using (SqlDataAdapter ada = new SqlDataAdapter((string)quy, Logic.ConnectionString))
                    //{
                    //    ada.Fill(dataSet1, "table");
                    //}

                    //XtraRepCrossTab reportAct = new XtraRepCrossTab();

                    //reportAct.xrLabel1.Text = string.Format(" {0} STATE GOVERNMENT ", Program.StateName.ToUpper());

                    //reportAct.xrLabel2.Text = string.Format(" TRANSFER / CHARGES OF ACCOUNT DETAILS OF IGR FOR THE  {0} ,{1}", cboPeriods.Text, cboYears.SelectedValue);

                    //reportAct.xrPivotGrid1.DataSource = dataSet1;

                    //reportAct.xrPivotGrid1.DataMember = "table";

                    //reportAct.ShowPreviewDialog();
                    #endregion

                    DataSet dataSet1 = new DataSet();

                    string query = string.Format("SELECT AccountNo, OpenBal, CloseBal, Amount, transdescription, BankShortCode, BankName, StartDate, EndDate FROM  ViewIGRAccountDetails WHERE CONVERT(VARCHAR(10),StartDate,103)='{0}' AND CONVERT(VARCHAR(10),EndDate,103)='{1}'", string.Format("{0:dd/MM/yyy}", dtpStart.Value), string.Format("{0:dd/MM/yyy}", dtpEnd.Value));
                    using (SqlDataAdapter ada = new SqlDataAdapter((string)query, Logic.ConnectionString))
                    {
                        ada.Fill(dataSet1, "table");
                    }

                    if (dataSet1.Tables[0].Rows.Count == 0)
                    {
                        Common.setMessageBox("No Record For This Report ", Program.ApplicationName, 1);
                        return;
                    }
                    else
                    {
                        XtraRepIGRAccounts repacct = new XtraRepIGRAccounts();

                        repacct.xrLabel27.Text = string.Format(" {0} STATE GOVERNMENT ", Program.StateName.ToUpper());

                        repacct.xrLabel28.Text = string.Format(" DETAILS OF TRANSFER / CHARGES FOR THE MONTH OF  {0} ,{1}", dtf.GetMonthName(dtpStart.Value.Month), dtpStart.Value.Year);

                        //repacct.paramPeriod.Value = dtpStart.Value.Month;

                        //repacct.paramYear.Value = dtpStart.Value.Year;
                        repacct.DataSource = dataSet1;

                        repacct.DataMember = "table";

                        repacct.ShowPreviewDialog();
                    }
                }
                else if (radioGroup1.EditValue == "Revenue")
                {
                    System.Data.DataSet ds = new System.Data.DataSet();

                    string quy = string.Format("SELECT Row_number() OVER ( ORDER BY ( SELECT   1 ) ) AS SN ,RevenueCode , Description ,SUM(Amount) AS Amount FROM ViewReportReconciliationCollection WHERE (CONVERT(VARCHAR, CONVERT(DATE, PaymentDate), 102) BETWEEN'{0}' and '{1}') GROUP BY RevenueCode ,Description", string.Format("{0:yyyy.MM.dd}", dtpStart.Value), string.Format("{0:yyyy.MM.dd}", dtpEnd.Value));

                    using (SqlDataAdapter ada = new SqlDataAdapter((string)quy, Logic.ConnectionString))
                    {
                        ada.Fill(ds, "table");
                    }

                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        Common.setMessageBox("No Record For This Report ", Program.ApplicationName, 1);
                        return;
                    }
                    else
                    {
                        XtraRepSummRevenue report = new XtraRepSummRevenue()
                        {
                            DataSource = ds, DataMember = "table"
                        };
                        report.paramMonths.Value = dtpStart.Value.Month;
                        report.paramYear.Value   = dtpStart.Value.Year;

                        report.xrLabel32.Text = string.Format(" {0} STATE GOVERNMENT ", Program.StateName.ToUpper());

                        report.xrLabel33.Text = string.Format("Summary of Collection by Revenue Type for the Month of  {0} , {1}", dtf.GetMonthName(dtpStart.Value.Month), dtpStart.Value.Year);

                        report.ShowPreviewDialog();
                    }
                    //[Months]
                    //FilterString = "StartsWith([BankCode], ?paramBankCode) And [Period] = ?paramPeriod And [IsRecordExit] = ?paramRecord"
                }
                else if (radioGroup1.EditValue == "Agency")
                {
                    System.Data.DataSet ds = new System.Data.DataSet();

                    string quy = string.Format("SELECT Row_number() OVER ( ORDER BY ( SELECT   1 ) ) AS SN ,AgencyCode ,AgencyName ,SUM(Amount)AS Amount  FROM ViewReportReconciliationagency WHERE (CONVERT(VARCHAR, CONVERT(DATE, PaymentDate), 102) BETWEEN'{0}' and '{1}') GROUP BY AgencyCode ,AgencyName", string.Format("{0:yyyy.MM.dd}", dtpStart.Value), string.Format("{0:yyyy.MM.dd}", dtpEnd.Value));

                    using (SqlDataAdapter ada = new SqlDataAdapter((string)quy, Logic.ConnectionString))
                    {
                        ada.Fill(ds, "table");
                    }

                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        Common.setMessageBox("No Record For This Report ", Program.ApplicationName, 1);
                        return;
                    }
                    else
                    {
                        XtraRepSummrayAgency repAgency = new XtraRepSummrayAgency()
                        {
                            DataSource = ds, DataMember = "table"
                        };
                        repAgency.xrLabel32.Text = string.Format(" {0} STATE GOVERNMENT ", Program.StateName.ToUpper());

                        repAgency.xrLabel33.Text = string.Format("Summary of Collection by Agencies for the Month of  {0} , {1}", dtf.GetMonthName(dtpStart.Value.Month), dtpStart.Value.Year);
                        repAgency.ShowPreviewDialog();
                    }
                }
                else if (radioGroup1.EditValue == "Details")
                {
                    System.Data.DataSet ds = new System.Data.DataSet();

                    string quy = string.Format("SELECT PaymentDate, PayerName, RevenueCode, ChequeValueDate, Description, Amount, Period, BankCode, years, PaymentRefNumber, Months,IsRecordExit, IsPayDirect, AgencyName, AgencyCode, BankName FROM ViewReconciliationAgencyDetails WHERE (CONVERT(VARCHAR, CONVERT(DATE, PaymentDate), 102) BETWEEN'{0}' and '{1}')", string.Format("{0:yyyy.MM.dd}", dtpStart.Value), string.Format("{0:yyyy.MM.dd}", dtpEnd.Value));

                    using (SqlDataAdapter ada = new SqlDataAdapter((string)quy, Logic.ConnectionString))
                    {
                        ada.Fill(ds, "table");
                    }

                    if (ds.Tables[0].Rows.Count == 0)
                    {
                        Common.setMessageBox("No Record For This Report ", Program.ApplicationName, 1);
                        return;
                    }
                    else
                    {
                        XtraRepAgencyDetails report = new XtraRepAgencyDetails();
                        report.xrLabel32.Text = string.Format(" {0} STATE GOVERNMENT ", Program.StateName.ToUpper());
                        report.xrLabel33.Text = string.Format("Summary of Collection by Agencies Details for the Month of  {0} , {1}", dtf.GetMonthName(dtpStart.Value.Month), dtpStart.Value.Year);

                        report.paramMonths.Value = dtpStart.Value.Month;
                        report.paramYears.Value  = dtpStart.Value.Year;
                        report.ShowPreviewDialog();
                    }
                }
            }
        }