Beispiel #1
0
        private void button1close_Click(object sender, EventArgs e)
        {
            administrator adm = new administrator();

            adm.Show();
            this.Hide();
        }
Beispiel #2
0
        private void btnclose_Click(object sender, EventArgs e)
        {
            txtaddress.Text = "";
            txtemail.Text   = "";
            txtfname.Text   = "";
            txtidno.Text    = "";
            txtoname.Text   = "";
            txtphone.Text   = "";
            txtreg.Text     = "";
            txtyear.Text    = "";
            cmbcourse.Text  = "";
            administrator adm = new administrator();

            adm.Show();
            this.Hide();
        }
Beispiel #3
0
        private void btnlogin_Click(object sender, EventArgs e)
        {
            string query = "SELECT username,password FROM adminlogin WHERE username= '******' AND password = '******'";

            if ((txtusername.Text.Length > 0) && (txtpassword.Text.Length > 0))
            {
                try
                {
                    if (this.OpenConnection() == true)
                    {
                        MySqlCommand    cmd = new MySqlCommand(query, connection);
                        MySqlDataReader rd  = cmd.ExecuteReader();
                        if (rd.Read())
                        {
                            MessageBox.Show("ADMIN LOGIN CONFIRMED.", "ADMINISTRATOR!!", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                            rd.Close();
                            this.closeConnection();
                            txtusername.Text = "";
                            txtpassword.Text = "";
                            administrator ad = new administrator();
                            ad.Show();
                            this.Hide();
                        }
                        else
                        {
                            MessageBox.Show("ADMIN DETAILS NOT FOUND \n MAKE SURE YOU ARE THE AUTHENTIFIED ADMIN!!! .", "NOT REGISTERED", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                            this.closeConnection();
                            rd.Close();
                        }
                    }
                    else
                    {
                        MessageBox.Show("Check the connection and try again.", "CONNECTION ERROR", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                    this.closeConnection();
                }
            }
            else
            {
                MessageBox.Show("Please make your entries valid!!!");
            }
        }