Exemplo n.º 1
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            String strAdminID  = tbAdminID.Text;
            String strPassword = tbPassword.Text;

            strAdminID.Trim();
            strPassword.Trim();

            if (strAdminID.Equals(""))
            {
                MessageBox.Show("Kindly provide Admin ID.", "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (strPassword.Equals(""))
            {
                MessageBox.Show("Kindly provide Password for validation.", "Alert Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            try
            {
                DBConnect DB = new DBConnect();
                if (DB.OpenConnection())
                {
                    DB.CloseConnection();
                    if (!DB.ValidateAdmin(strAdminID, strPassword))
                    {
                        MessageBox.Show("Invalid Userid OR Password", "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error);

                        return;
                    }
                }
                else
                {
                    DB.CloseConnection();
                    return;
                }
            }catch (Exception e1)
            {
                return;
            }

            SATSystem.getInstance().bValidAdmin = true;
            SATSystem.getInstance().Initate();

            if (frmLoading1 == null)
            {
                frmLoading1                 = new frmLoading();
                frmLoading1.strMessage      = "Validating Admin Credential...";
                frmLoading1.FormBorderStyle = FormBorderStyle.None;
                frmLoading1.FormClosed     += frmLoading1_FormClosed;
                frmLoading1.Show();
            }
            else
            {
                frmLoading1.Activate();
            }
        }
Exemplo n.º 2
0
        private void bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            SATSystem.getInstance().mExitCode = 1;

            if (frmLoading1 == null)
            {
                frmLoading1                 = new frmLoading();
                frmLoading1.strMessage      = "Student RFID Card Identified";// +SATSystem.getInstance().mRFIDTagID;
                frmLoading1.FormBorderStyle = FormBorderStyle.None;
                frmLoading1.FormClosed     += frmLoading1_FormClosed;
                frmLoading1.Show();
            }
            else
            {
                frmLoading1.Activate();
            }
        }