Beispiel #1
0
        /// <summary>
        /// Button login click event. This method assumes that connexion file is valid. If the user can be identified, this method set the user id of FormChecking class.
        /// </summary>
        private void BtnLogIn_Click(object sender, EventArgs e)
        {
            UInt32 UserID_UL   = 0;
            bool   IsManager_b = false;

            // Record username in configuration file if check box remember me is checked, else reset property
            RecordConnexionInfo();

            // Verify matching username - pwd
            if (mDBManager_O.mConnected_b)
            {
                mDBManager_O.mStoredProcedureManager_O.STPROC_VerifyUser(TxtUserName.Text, TxtPwd.Text, out UserID_UL, out IsManager_b);
            }

            if (UserID_UL > 0)
            {
                this.Hide();

                if (IsManager_b)
                {
                    FormManager FormManager_O = new FormManager(mDBManager_O, UserID_UL);
                    FormManager_O.ShowDialog();
                }
                else
                {
                    FormChecking FormCheking_O = new FormChecking(mDBManager_O, UserID_UL);
                    FormCheking_O.ShowDialog();
                }

                try
                {
                    this.Show();
                }
                catch (ObjectDisposedException Exception_O)
                {
                    // In this case an application exit was called and application should juste shut down
                    this.Dispose();
                }
            }
            else
            {
                MessageBox.Show("Mot de passe incorrect.", "Erreur !");
            }

            TxtPwd.Text = "";
        }
Beispiel #2
0
        private void ToolStripBtnChecking_Click(object sender, EventArgs e)
        {
            FormChecking FormChecking_O = new FormChecking(mDBManager_O, mUserID_UL);

            FormChecking_O.Show();
        }