Пример #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 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();
                    //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);
            }
        }
Пример #2
0
        void OnNavBarItemsClicked(object sender, DevExpress.XtraNavBar.NavBarLinkEventArgs e)
        {
            if (sender != navBarItemExit)
            {
                RemoveControls();
            }

            if (sender == navBarItemCheck)
            {
                //Process prupdate = Process.Start("wyUpdate.exe");
                CheckUpdate();
            }
            else if (sender == navBarItemHelp)
            {
                //Help.ShowHelp(this, "C:\\Users\\Femmy\\Documents\\Visual Studio 2010\\Projects\\TSS_Oyo\\BankReconciliation\\reconciliation.chm");
            }
            else if (sender == navBarItem1)
            {
                tableLayoutPanel2.Controls.Add((new FrmPeriods().panelContainer), 1, 0);

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

                FrmPeriods.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItem6)
            {
                using (var frm = new FrmChangePassword())
                {
                    frm.ShowDialog();
                }
            }
            else if (sender == navBITmMinisrty)
            {
                tableLayoutPanel2.Controls.Add((new FrmMinistryApproval().panelContainer), 1, 0);

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

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

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

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

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

                FrmCloseFinanical.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemIGR)
            {
                tableLayoutPanel2.Controls.Add((new FrmReportIGR().panelContainer), 1, 0);

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

                FrmReportIGR.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItem5)
            {
                tableLayoutPanel2.Controls.Add((new FrmExchangeRate().panelContainer), 1, 0);

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

                FrmExchangeRate.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBITMReconciliationPeriod)
            {
                tableLayoutPanel2.Controls.Add((new FrmReconciliationperid().panelContainer), 1, 0);

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

                FrmReconciliationperid.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItem3)
            {
                tableLayoutPanel2.Controls.Add((new Frmunswept().panelContainer), 1, 0);

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

                Frmunswept.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarList)
            {
                tableLayoutPanel2.Controls.Add((new FrmDelist().panelContainer), 1, 0);

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

                FrmDelist.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarYear)
            {
                tableLayoutPanel2.Controls.Add((new FrmYearly().panelContainer), 1, 0);

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

                FrmYearly.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItem4)
            {
                tableLayoutPanel2.Controls.Add((new FrmSwept().panelContainer), 1, 0);

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

                FrmSwept.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemToken)
            {
                tableLayoutPanel2.Controls.Add((new frmtoken().panelContainer), 1, 0);

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

                frmtoken.publicStreetGroup.RefreshForm();
            }
            //else if (sender == navBarItem6)
            //{
            //    tableLayoutPanel2.Controls.Add((new FrmAnalysis().panelContainer), 1, 0);

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

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

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

                FrmSummaryAG.publicStreetGroup.RefreshForm();
            }
            //else if (sender == navBarItemDataUpload)
            //{
            //    //tableLayoutPanel2.Controls.Add((new FrmUpload().panelContainer), 1, 0);

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

            //    //FrmUpload.publicStreetGroup.RefreshForm();
            //}
            else if (sender == navBarItemDefaultAgency)
            {
                tableLayoutPanel2.Controls.Add((new FrmAgencyUk().panelContainer), 1, 0);

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

                FrmAgencyUk.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemDefaultRevenue)
            {
                tableLayoutPanel2.Controls.Add((new FrmTempRevenue().panelContainer), 1, 0);
                FrmTempRevenue.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;
                FrmTempRevenue.publicStreetGroup.RefreshForm();
                //FrmRevenuetemp.publicStreetGroup.Tag = ((sender) as NavBarItem).Tag;

                //FrmRevenuetemp.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemBank)
            {
                tableLayoutPanel2.Controls.Add((new FrmAccountBank().panelContainer), 1, 0);

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

                FrmAccountBank.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarClearTrans)
            {
                tableLayoutPanel2.Controls.Add((new FrmClear().panelContainer), 1, 0);

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

                FrmClear.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemPostingRequest)
            {
                tableLayoutPanel2.Controls.Add((new FrmRequestNew().panelContainer), 1, 0);

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

                FrmRequestNew.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemClosePeriod)
            {
                tableLayoutPanel2.Controls.Add((new FrmRequest().panelContainer), 1, 0);

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

                FrmRequest.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemBanks)
            {
                //tableLayoutPanel2.Controls.Add((new FrmExecption().panelControl1), 1, 0);

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

                //FrmExecption.publicStreetGroup.RefreshForm();

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

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

                FrmTransaction.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBItmReclassified)
            {
                tableLayoutPanel2.Controls.Add((new FrmReclassified().panelContainer), 1, 0);

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

                FrmReclassified.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBitmGet)
            {
                tableLayoutPanel2.Controls.Add((new FrmGet().panelContainer), 1, 0);

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

                FrmGet.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemSchedule)
            {
                tableLayoutPanel2.Controls.Add((new FrmSchedule().panelContainer), 1, 0);

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

                FrmSchedule.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemDefaultZonalRevenue)
            {
                tableLayoutPanel2.Controls.Add((new FrmZonalTemp().panelContainer), 1, 0);

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

                FrmZonalTemp.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemFiscal)
            {
                tableLayoutPanel2.Controls.Add((new FrmPeriods().panelContainer), 1, 0);

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

                FrmPeriods.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemRefernceletter)
            {
                tableLayoutPanel2.Controls.Add((new FrmStateRef().panelContainer), 1, 0);

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

                FrmStateRef.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemTransaction)
            {
                tableLayoutPanel2.Controls.Add((new FrmTransactionSetup().panelContainer), 1, 0);

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

                FrmTransactionSetup.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemTransactionType)
            {
                tableLayoutPanel2.Controls.Add((new FrmViewTransaction().panelContainer), 1, 0);

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

                FrmViewTransaction.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemCollectionControl)
            {
                tableLayoutPanel2.Controls.Add((new FrmCollectionControl().panelContainer), 1, 0);

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

                FrmCollectionControl.publicStreetGroup.RefreshForm();
            }
            else if (sender == navBarItemExit)
            {
                Close();
            }
            //else if (sender == navBarItemDataUpload)
            //{
            //    tableLayoutPanel2.Controls.Add((new FrmTransaction().panelContainer), 1, 0);

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

            //    FrmTransaction.publicStreetGroup.RefreshForm();

            //}
        }