Ejemplo n.º 1
0
        bool ProcessLoginDetails()
        {
            bool bResponse = false;

            if (String.IsNullOrEmpty(txtUsername.Text) || String.Equals(txtUsername.Text, "[Set User Name]"))
            {
                Common.setEmptyField("Username", Program.ApplicationName);
                txtUsername.Focus();
                return(false);
            }
            else if (String.IsNullOrEmpty(txtPassword.Text) || String.Equals(txtPassword.Text, "[Set Password]"))
            {
                Common.setEmptyField("Password", Program.ApplicationName);
                txtPassword.Focus();
                return(false);
            }
            else
            {
                string SQL = String.Format(@"SELECT COUNT(*) FROM [dbo].[ViewUserApplication] WHERE [UserID] = '{0}' AND [Password] = '{1}' AND [ApplicationCode] = '{2}' AND [Flag] = 1", txtUsername.Text, Encryption.Encrypt(txtPassword.Text), Program.ApplicationCode);
                if (new Classess.Logic().IsRecordExist(SQL))
                //if (true)
                {
                    if (Logic.IsUserAccountExpired(txtUsername.Text))
                    {
                        Common.setMessageBox(
                            "Your Login Credential has expired. Please contact administrator",
                            Program.ApplicationName, 3);
                        ManageLoginTimeOut(false);
                        return(false);
                    }
                    if (Logic.IsUserAccountSuspended(txtUsername.Text))
                    {
                        Common.setMessageBox(
                            "Your Account has been suspended. Please contact administrator",
                            Program.ApplicationName, 3);
                        ManageLoginTimeOut(false);
                        return(false);
                    }
                    if (!Logic.IsUserEmailValid(txtUsername.Text))
                    {
                        Common.setMessageBox(
                            "Your Account has no Email Address. Please contact administrator",
                            Program.ApplicationName, 3);
                        ManageLoginTimeOut(false);
                        return(false);
                    }
                    if (Logic.IsUserFirstLogin(txtUsername.Text))
                    {
                        Common.setMessageBox(
                            "Thank You for registering on this platform.\n\nYou will be required to setup new login credential to continue",
                            Program.ApplicationName, 2);
                        //this.Hide();
                        using (var frm = new FrmChangePassword())
                        {
                            //frm.txtuse = username;
                            //frm.Password = txtPassword.Text.As(null);
                            if (frm.ShowDialog() == DialogResult.OK)
                            {
                                Common.setMessageBox("Please Login again with the New Credential to continue", Program.ApplicationName, 1);
                                BttnCancel.PerformClick();
                            }
                        }
                    }

                    Program.UserID = txtUsername.Text;
                    bResponse      = true;
                }
                else
                {
                    ManageLoginTimeOut(true);

                    //if (lblAttempt.Text == "1")
                    //{
                    //    Common.setMessageBox("You already used all the attempts.\nThis will terminate the application.", Program.ApplicationName, 3);
                    //    this.Close();
                    //}
                    //else
                    //{
                    //    int iAttempt;
                    //    iAttempt = Convert.ToInt32(lblAttempt.Text) - 1;
                    //    lblAttempt.Text = iAttempt.ToString();
                    //    Common.setMessageBox(String.Format("Invalid Username/Password. Please try again.\n\nWarning: You only have {0} attempt.", lblAttempt.Text), Program.ApplicationName, 3);
                    //}
                    bResponse = false;
                }
            }
            return(bResponse);
            //}
        }
Ejemplo n.º 2
0
        void OnNavBarItemsClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            if (sender != navBarItemExit)
            {
                RemoveControls();
            }

            //if (sender == navBarItemCollImpt)
            //{
            //    FrmImports.tableType = 1;

            //    tableLayoutPanel2.Controls.Add((new FrmImports().panelContainer), 1, 0);

            //    FrmImports.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

            //    FrmImports.publicStreetGroup.RefreshForm();
            //}
            //else if (sender == navBarItemTaxAgentImpt)
            //{
            //    FrmImports.tableType = 2;

            //    tableLayoutPanel2.Controls.Add((new FrmImports().panelContainer), 1, 0);

            //    FrmImports.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

            //    FrmImports.publicStreetGroup.RefreshForm();

            //}
            //else if (sender == navBarItemTaxPayerImpt)
            //{
            //    FrmImports.tableType = 3;

            //    tableLayoutPanel2.Controls.Add((new FrmImports().panelContainer), 1, 0);

            //    FrmImports.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

            //    FrmImports.publicStreetGroup.RefreshForm();
            //}
            //if (sender == navBarItemCollExp)
            //{
            //    FrmExport.tableType = 1;

            //    tableLayoutPanel2.Controls.Add((new FrmExport().panelContainer), 1, 0);

            //    FrmExport.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

            //    FrmExport.publicStreetGroup.RefreshForm();
            //}

            if (sender == navBarItemSplitTransaction)
            {
                tableLayoutPanel2.Controls.Add((new FrmSplit().panelContainer), 1, 0);

                FrmSplit.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                FrmSplit.publicInstance.RefreshForm();
            }
            else if (sender == navBarItem8)//change password
            {
                using (var frm = new FrmChangePassword())
                {
                    frm.ShowDialog();
                }
            }
            else if (sender == navBarItCheck)
            {
                //string paths = AppDomain.CurrentDomain.BaseDirectory;
                CheckUpdate();
            }
            else if (sender == navBarItem1)
            {
                tableLayoutPanel2.Controls.Add((new FrmPayment().panelContainer), 1, 0);

                FrmPayment.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                FrmPayment.publicInstance.RefreshForm();

                FrmPayment.boolIsUpdate = true;
            }
            else if (sender == navBarItem6)
            {
                tableLayoutPanel2.Controls.Add((new FrmCreatMainfest().panelContainer), 1, 0);

                FrmCreatMainfest.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                FrmCreatMainfest.publicInstance.RefreshForm();
            }
            else if (sender == navBarItem2)
            {
                tableLayoutPanel2.Controls.Add((new FrmPayment().panelContainer), 1, 0);

                FrmPayment.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                FrmPayment.publicInstance.RefreshForm();

                FrmPayment.boolIsUpdate = false;
            }
            else if (sender == navBarItmTCO)
            {
                tableLayoutPanel2.Controls.Add((new FrmTCO().panelContainer), 1, 0);

                FrmTCO.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                FrmTCO.publicInstance.RefreshForm();
            }
            //else if (sender == navBarItemTaxPayerExp)
            //{
            //    FrmExport.tableType = 3;

            //    tableLayoutPanel2.Controls.Add((new FrmExport().panelContainer), 1, 0);

            //    FrmExport.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

            //    FrmExport.publicStreetGroup.RefreshForm();
            //}
            //else if (sender == navBarItemTransactionPending)
            //{
            //    tableLayoutPanel2.Controls.Add((new FrmPending().panelContainer), 1, 0);

            //    FrmPending.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

            //    FrmPending.publicStreetGroup.RefreshForm();
            //}
            //else if (sender == navBarItemCashBank)
            //{
            //    tableLayoutPanel2.Controls.Add((new FrmCashiers().panelContainer), 1, 0);

            //    FrmCashiers.publicInstance.Tag = ((sender) as NavBarItem).Tag;

            //    FrmCashiers.publicInstance.RefreshForm();

            //}
            else if (sender == navBarItmArmsSearch)
            {
                tableLayoutPanel2.Controls.Add((new FrmArmsSearch().panelContainer), 1, 0);
                FrmArmsSearch.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;
                FrmArmsSearch.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItmArmsApproval)
            {
                tableLayoutPanel2.Controls.Add((new FrmArmsApproval().panelContainer), 1, 0);
                FrmArmsApproval.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;
                FrmArmsApproval.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemReceiptIssuedReport)
            {
                tableLayoutPanel2.Controls.Add((new FrmIssueReport().panelContainer), 1, 0);
                FrmIssueReport.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;
                FrmIssueReport.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemReceiptModification)
            {
                tableLayoutPanel2.Controls.Add((new FrmModification().panelContainer), 1, 0);
                FrmModification.publicInstance.Tag = ((sender) as NavBarItem).Tag;
                FrmModification.publicInstance.RefreshForm();
            }
            else if (sender == navBarItem5)
            {
                tableLayoutPanel2.Controls.Add((new FrmStations().panelContainer), 1, 0);
                //FrmStations.publicInstance.Tag = ((sender) as NavBarItem).Tag;
                FrmStations.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;
                FrmStations.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItem4)
            {
                tableLayoutPanel2.Controls.Add((new FrmGetApproved().panelContainer), 1, 0);
                FrmGetApproved.publicInstance.Tag = ((sender) as NavBarItem).Tag;
                FrmGetApproved.publicInstance.RefreshForm();
            }
            else if (sender == navBarImtProfile)
            {
                tableLayoutPanel2.Controls.Add((new FrmProfile().panelContainer), 1, 0);
                FrmProfile.publicInstance.Tag = ((sender) as NavBarItem).Tag;
                FrmProfile.publicInstance.RefreshForm();
            }
            //else if (sender == navBarItemCollect)
            //{
            //    ////tableLayoutPanel2.Controls.Add((new FrmDownload().panelContainer), 1, 0);
            //    tableLayoutPanel2.Controls.Add((new FrmDownloadSources().panelContainer), 1, 0);

            //    //FrmDownloadSources

            //}
            else if (sender == navBarItemDemandReceipt)
            {
                tableLayoutPanel2.Controls.Add((new FrmDemand().panelContainer), 1, 0);

                FrmDemand.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

                FrmDemand.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItem7)
            {
                tableLayoutPanel2.Controls.Add((new FrmFirstApproval().panelContainer), 1, 0);

                FrmFirstApproval.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

                FrmFirstApproval.publicStreetGroup.RefreshForm();
            }
            //else if (sender == navBarItemSummary)
            //{
            //    //FrmSummaryReport
            //    tableLayoutPanel2.Controls.Add((new FrmSummaryReport().panelContainer), 1, 0);

            //    //FrmSummaryReport.publicInstance.Tag = ((sender) as NavBarItem).Tag;

            //    //FrmSummaryReport.publicInstance.RefreshForm();

            //    FrmSummaryReport.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;
            //    FrmSummaryReport.publicStreetGroup.RefreshForm();

            //}
            else if (sender == navBarItemReceiptCentre)
            {
                tableLayoutPanel2.Controls.Add((new FrmReceiptsCentre().panelContainer), 1, 0);

                FrmReceiptsCentre.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                FrmReceiptsCentre.publicInstance.RefreshForm();
            }
            //else if (sender == navBarItemPrrintingCentreMap)
            //{
            //    tableLayoutPanel2.Controls.Add((new FrmReceiptCentreMap().panelContainer), 1, 0);

            //    FrmReceiptCentreMap.publicInstance.Tag = ((sender) as NavBarItem).Tag;

            //    FrmReceiptCentreMap.publicInstance.RefreshForm();
            //}
            //else if (sender == navBarItemCheckUpdate)
            //{
            //    Process prupdate = Process.Start("wyUpdate.exe");

            //}
            else if (sender == navBarItemReceiptGenerated)
            {
                tableLayoutPanel2.Controls.Add((new FrmGenerate().panelContainer), 1, 0);

                FrmGenerate.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                //FrmGenerate.publicInstance.RefreshForm();
            }
            else if (sender == navBarItem3)
            {
                tableLayoutPanel2.Controls.Add((new FrmAgecnyMainfest().panelContainer), 1, 0);

                FrmAgecnyMainfest.publicInstance.Tag = ((sender) as NavBarItem).Tag;
            }
            else if (sender == navBarItemReceiptDemand)
            {
                //tableLayoutPanel2.Controls.Add((new FrmReceiptDemand().panelContainer), 1, 0);
                tableLayoutPanel2.Controls.Add((new FrmPendReceipts().panelContainer), 1, 0);

                FrmPendReceipts.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                FrmPendReceipts.publicInstance.RefreshForm();
            }
            else if (sender == navBarItemStationData)
            {
                tableLayoutPanel2.Controls.Add((new FrmStationDownload().panelContainer), 1, 0);

                FrmStationDownload.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

                FrmStationDownload.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemCentreData)
            {
                tableLayoutPanel2.Controls.Add((new FrmCentralData().panelContainer), 1, 0);

                FrmCentralData.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

                FrmCentralData.publicStreetGroup.RefreshForm();
            }
            //else if (sender == navBarItemStations)
            //{
            //    tableLayoutPanel2.Controls.Add((new FrmStations().panelContainer), 1, 0);

            //    //FrmStations.publicInstance.Tag = ((sender) as NavBarItem).Tag;

            //    FrmStations.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

            //    FrmStations.publicStreetGroup.RefreshForm();

            //}
            //else if (sender == navBarItemReceiptCancel)
            //{
            //    tableLayoutPanel2.Controls.Add((new FrmReceiptCancel().panelContainer), 1, 0);

            //    FrmReceiptCancel.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

            //    FrmReceiptCancel.publicStreetGroup.RefreshForm();
            //}
            else if (sender == navBarItemPrintReceipt)
            {
                //tableLayoutPanel2.Controls.Add((new FrmPrintOption().panelContainer), 1, 0);
                var rec = new FrmReceipts();
                if (!rec.IsDisposed)
                {
                    tableLayoutPanel2.Controls.Add((rec.panelContainer), 1, 0);
                }

                FrmReceipts.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                FrmReceipts.publicInstance.RefreshForm();
            }
            //else if (sender == navBarItemStationMap)
            //{
            //    tableLayoutPanel2.Controls.Add((new FrmStationMap().panelContainer), 1, 0);

            //    FrmStationMap.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

            //    FrmStationMap.publicStreetGroup.RefreshForm();
            //}
            else if (sender == navBarItemReceipt)
            {
                tableLayoutPanel2.Controls.Add((new FrmDetailsReceipts().panelContainer), 1, 0);

                FrmDetailsReceipts.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                FrmDetailsReceipts.publicInstance.RefreshForm();
            }
            else if (sender == navBarItemSearchReceipts)
            {
                tableLayoutPanel2.Controls.Add((new FrmSearchReceipts().panelContainer), 1, 0);

                FrmSearchReceipts.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                FrmSearchReceipts.publicInstance.RefreshForm();
            }
            else if (sender == navBarItemPriningRevenueCode)
            {
                tableLayoutPanel2.Controls.Add((new FrmRevException().panelContainer), 1, 0);

                //FrmRevException.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                FrmRevException.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

                //FrmRevException.publicInstance.RefreshForm();
                FrmRevException.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemReceiptReportDetails)
            {
                using (System.Data.DataSet dds = new System.Data.DataSet("DsCollectionReport"))
                {
                    SqlDataAdapter ada;

                    DataTable Dt = dds.Tables.Add("CollectionReportTable");
                    ada = new SqlDataAdapter((string)"SELECT ID, Provider, Channel, Collection.tblCollectionReport.PaymentRefNumber, DepositSlipNumber, PaymentDate, PayerID, PayerName, Amount, PaymentMethod, ChequeNumber, ChequeValueDate, ChequeStatus, DateChequeReturned, TelephoneNumber, ReceiptNo, ReceiptDate, PayerAddress, [User], RevenueCode, Description, ChequeBankCode, ChequeBankName, AgencyName, AgencyCode, BankCode, BankName, BranchCode, BranchName, ZoneCode, ZoneName, Username,  AmountWords, Collection.tblCollectionReport.EReceipts, Collection.tblCollectionReport.EReceiptsDate, GeneratedBy,  Receipt.tblCollectionReceipt.UploadStatus, Receipt.tblCollectionReceipt.PrintedBY,Receipt.tblCollectionReceipt.ControlNumber, Receipt.tblCollectionReceipt.BatchNumber, Collection.tblCollectionReport.StationCode,(SELECT StationName FROM Receipt.tblStation WHERE StationCode = Collection.tblCollectionReport.StationCode) AS Stationname, Receipt.tblCollectionReceipt.isPrinted,Receipt.tblCollectionReceipt.IsPrintedDate FROM Collection.tblCollectionReport LEFT JOIN Receipt.tblCollectionReceipt ON Collection.tblCollectionReport.PaymentRefNumber = Receipt.tblCollectionReceipt.PaymentRefNumber", Logic.ConnectionString);
                    ada.Fill(dds, "CollectionReportTable");

                    Report.XRepReceiptReport receiptReport = new XRepReceiptReport {
                        DataSource = dds /*recportRec.DataAdapter = ada;*/, DataMember = "CollectionReportTable"
                    };

                    receiptReport.ShowPreviewDialog();
                }
            }
            else if (sender == navBarStationCollection)
            {
                using (System.Data.DataSet dds = new System.Data.DataSet("DsCollectionReport"))
                {
                    SqlDataAdapter ada;

                    string query = "SELECT ID, Provider, Channel, Collection.tblCollectionReport.PaymentRefNumber, DepositSlipNumber, PaymentDate, PayerID, PayerName, Amount, PaymentMethod, ChequeNumber, ChequeValueDate, ChequeStatus, DateChequeReturned, TelephoneNumber, ReceiptNo, ReceiptDate, PayerAddress, [User], RevenueCode, Description, ChequeBankCode, ChequeBankName, AgencyName, AgencyCode, BankCode, BankName, BranchCode, BranchName, ZoneCode, ZoneName, Username,  AmountWords, Collection.tblCollectionReport.EReceipts, Collection.tblCollectionReport.EReceiptsDate, GeneratedBy,  Receipt.tblCollectionReceipt.UploadStatus, Receipt.tblCollectionReceipt.PrintedBY,Receipt.tblCollectionReceipt.ControlNumber, Receipt.tblCollectionReceipt.BatchNumber, Collection.tblCollectionReport.StationCode,(SELECT StationName FROM Receipt.tblStation WHERE StationCode = Collection.tblCollectionReport.StationCode) AS Stationname, Receipt.tblCollectionReceipt.isPrinted,Receipt.tblCollectionReceipt.IsPrintedDate FROM Collection.tblCollectionReport LEFT JOIN Receipt.tblCollectionReceipt ON Collection.tblCollectionReport.PaymentRefNumber = Receipt.tblCollectionReceipt.PaymentRefNumber";

                    DataTable Dt = dds.Tables.Add("CollectionReportTable");
                    ada = new SqlDataAdapter(query, Logic.ConnectionString);
                    ada.Fill(dds, "CollectionReportTable");

                    //Report.XtraRepDetails repost = new XtraRepDetails();
                    //repost.ShowPreviewDialog();

                    Report.XtraRepDetails repost = new XtraRepDetails {
                        DataSource = dds /*recportRec.DataAdapter = ada;*/, DataMember = "CollectionReportTable"
                    };
                    repost.ShowPreviewDialog();
                }
            }
            else if (sender == navBarItemReprintReceipt)
            {
                tableLayoutPanel2.Controls.Add((new FrmReprinted().panelContainer), 1, 0);
            }
            else if (sender == navBarItemGeneral)
            {
                tableLayoutPanel2.Controls.Add((new FrmGeneral().panelContainer), 1, 0);

                FrmGeneral.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                FrmGeneral.publicInstance.RefreshForm();


                //                string vquery;
                //                try
                //                {
                //                    //vquery = String.Format(@"SELECT * FROM dbo.tblCollectionReport WHERE ID IN (SELECT * FROM [fnConvertCSVToINT]('{0}'))", IDList);

                //                    #region SQL
                //                    vquery = @"SELECT  [ID] ,
                //                                         [Provider] ,
                //                                         [Channel] ,
                //                                         [PaymentRefNumber] ,
                //                                         [DepositSlipNumber] ,
                //                                         CONVERT(VARCHAR,CONVERT(DATE,[PaymentDate]),103) AS PaymentDate,
                //                                         [PayerID] ,
                //                                         UPPER([PayerName]) AS [PayerName],
                //                                         [Amount] ,
                //                                         [PaymentMethod] ,
                //                                         [ChequeNumber] ,
                //                                         [ChequeValueDate] ,
                //                                         [ChequeStatus] ,
                //                                         [DateChequeReturned] ,
                //                                         [TelephoneNumber] ,
                //                                         [ReceiptNo] ,
                //                                         [ReceiptDate] ,
                //                                         [PayerAddress] ,
                //                                         [Status] ,
                //                                         [User] ,
                //                                         [RevenueCode] ,
                //                                         [Description] ,
                //                                         [ChequeBankCode] ,
                //                                         [ChequeBankName] ,
                //                                         [AgencyName] ,
                //                                         [AgencyCode] ,
                //                                         [BankCode] ,
                //                                         [BankName] ,
                //                                         [BranchCode] ,
                //                                         [BranchName] ,
                //                                         [ZoneCode] ,
                //                                         [ZoneName] ,
                //                                         [Username] ,
                //                                         [State] ,
                //                                         [AmountWords] ,
                //                                         [URL] ,
                //                                         [EReceipts] ,
                //                                         [EReceiptsDate] ,
                //                                         [GeneratedBy] ,
                //                                         [DateValidatedAgainst] ,
                //                                         [DateDiff] ,
                //                                         [UploadStatus] ,
                //                                         [PrintedBY] ,
                //                                         [DatePrinted] ,
                //                                         [ControlNumber] ,
                //                                         [BatchNumber] ,
                //                                         [StationCode] ,
                //--                                         [StationName]
                //--[StationName]
                //                                         (Select StationName from tblStation WHERE tblStation.StationCode = ViewCollectionReport.[StationCode]) AS StationName
                //                                 FROM    [dbo].[ViewCollectionReport]
                //                                  WHERE EReceipts IS NOT NULL ORDER BY ViewCollectionReport.AgencyCode,ViewCollectionReport.StationCode  ,ViewCollectionReport.RevenueCode,ViewCollectionReport.EReceipts";
                //                    #endregion
                //                    using (System.Data.DataSet dds = new System.Data.DataSet("DsCollectionReport"))
                //                    {
                //                        using (SqlDataAdapter ada = new SqlDataAdapter(vquery, Logic.ConnectionString))
                //                        {
                //                            ada.Fill(dds, "CollectionReportTable");
                //                            Report.XRepGlobalManifest Global = new Collection.Report.XRepGlobalManifest { DataSource = dds, DataAdapter = ada, DataMember = "CollectionReportTable", RequestParameters = true };
                //                            //Global.paramStartDate.Value = "EReceiptsDate";
                //                            //Global.paramEndDate.Value = "EReceiptsDate";
                //                            // Global.paramEndDate.Visible = false;
                //                            Global.ShowPreviewDialog();
                //                        }
                //                    }
                //                }
                //                catch
                //                {
                //                    vquery = @"SELECT [ID] ,
                //                                         [Provider] ,
                //                                         [Channel] ,
                //                                         [PaymentRefNumber] ,
                //                                         [DepositSlipNumber] ,
                //                                         [PaymentDate],
                //                                         [PayerID] ,
                //                                         UPPER([PayerName]) AS [PayerName],
                //                                         [Amount] ,
                //                                         [PaymentMethod] ,
                //                                         [ChequeNumber] ,
                //                                         [ChequeValueDate] ,
                //                                         [ChequeStatus] ,
                //                                         [DateChequeReturned] ,
                //                                         [TelephoneNumber] ,
                //                                         [ReceiptNo] ,
                //                                         [ReceiptDate] ,
                //                                         [PayerAddress] ,
                //                                         [Status] ,
                //                                         [User] ,
                //                                         [RevenueCode] ,
                //                                         [Description] ,
                //                                         [ChequeBankCode] ,
                //                                         [ChequeBankName] ,
                //                                         [AgencyName] ,
                //                                         [AgencyCode] ,
                //                                         [BankCode] ,
                //                                         [BankName] ,
                //                                         [BranchCode] ,
                //                                         [BranchName] ,
                //                                        [BankName]+' / '+ [BranchName] AS calcBankBranchCol,
                //                                         [ZoneCode] ,
                //                                         [ZoneName] ,
                //                                         [Username] ,
                //                                         [State] ,
                //                                         [AmountWords] ,
                //                                         [URL] ,
                //                                         [EReceipts] ,
                //                                         [EReceiptsDate] ,
                //                                         [GeneratedBy] ,
                //                                         [DateValidatedAgainst] ,
                //                                         [DateDiff] ,
                //                                         [UploadStatus] ,
                //                                         [PrintedBY] ,
                //                                         [DatePrinted] ,
                //                                         [ControlNumber] ,
                //                                         [BatchNumber] ,
                //                                         [StationCode] ,
                //                                     --[StationName]
                //--[StationName]
                //                                         (Select StationName from tblStation WHERE tblStation.StationCode = ViewCollectionReport.[StationCode]) AS StationName
                //                                 FROM    ViewCollectionReport WHERE EReceipts IS NOT NULL ORDER BY  ViewCollectionReport.AgencyCode ,ViewCollectionReport.StationCode ,ViewCollectionReport.RevenueCode,ViewCollectionReport.EReceipts";
                //                    using (System.Data.DataSet dds = new System.Data.DataSet("DsCollectionReport"))
                //                    {
                //                        using (SqlDataAdapter ada = new SqlDataAdapter(vquery, Logic.ConnectionString))
                //                        {
                //                            ada.Fill(dds, "CollectionReportTable");
                //                            Report.XRepGlobalManifest Global = new Collection.Report.XRepGlobalManifest { DataSource = dds, DataAdapter = ada, DataMember = "CollectionReportTable", RequestParameters = false };
                //                            Global.ShowPreviewDialog();
                //                        }
                //                    }
                //                }



                //Report.XRepGlobalManifest Global = new Collection.Report.XRepGlobalManifest();
                //Global.ShowPreviewDialog();
            }
            else if (sender == navBarItemPending)
            {
                Report.XRepPendTransaction pending = new Collection.Report.XRepPendTransaction();
                pending.ShowPreviewDialog();
            }
            else if (sender == navBarItemReprint)
            {
                tableLayoutPanel2.Controls.Add((new FrmPrintOption().panelContainer), 1, 0);

                FrmPrintOption.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                FrmPrintOption.publicInstance.RefreshForm();
            }
            else if (sender == navBarItemReceiptReceive)
            {
                tableLayoutPanel2.Controls.Add((new FrmReceiveRec().panelContainer), 1, 0);

                FrmReceiveRec.publicInstance.Tag = ((sender) as NavBarItem).Tag;


                FrmReceiveRec.publicInstance.RefreshForm();
            }
            else if (sender == navBarItemReceiptIssue)
            {
                tableLayoutPanel2.Controls.Add((new FrmIssueReceipts().panelContainer), 1, 0);

                //FrmIssueReceipts.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                FrmIssueReceipts.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

                //FrmIssueReceipts.publicInstance.RefreshForm();

                FrmIssueReceipts.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemRevenueException)
            {
                tableLayoutPanel2.Controls.Add((new FrmRevException().panelContainer), 1, 0);

                //FrmRevException.publicInstance.Tag = ((sender) as NavBarItem).Tag;

                FrmRevException.publicStreetGroup.RefreshForm();

                FrmRevException.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;
            }
            else if (sender == navBarItemLogout)
            {
                Program.App_LOGOUT = true;
                Application.Restart();
                Close();
            }
            else if (sender == navBarItemExit)
            {
                Close();
            }
        }