// // // // // // //             End Yes Button Action             // // // // // // //



        // // // // // // //             Begining No Button Action             // // // // // // //


        private void No_MouseClick(object sender, MouseEventArgs e)
        {
            if (usertype == 1)
            {
                this.Close();
                AdminHome soh = new AdminHome();
                soh.Show();
            }



            else if (usertype == 2)
            {
                this.Close();
                UniversityOfficerHome soh = new UniversityOfficerHome();
                soh.Show();
            }



            else if (usertype == 3)
            {
                this.Close();
                SecurityOfficerHome soh = new SecurityOfficerHome();
                soh.Show();
            }
        }
 private void btnBack_MouseClick(object sender, MouseEventArgs e)
 {
     if (type == 0)
     {
         this.Close();
         UniversityOfficerHome uoh = new UniversityOfficerHome();
         uoh.Show();
     }
     else if (type == 1)
     {
         this.Close();
         AdminHome uoh = new AdminHome();
         uoh.Show();
     }
 }
示例#3
0
        private void btnHBack_MouseClick(object sender, MouseEventArgs e)
        {
            if (selectForm == 0)
            {
                this.Close();
                SecurityOfficerHome soh = new SecurityOfficerHome();
                soh.Show();

                this.selectForm = 0;
            }
            else if (selectForm == 1)
            {
                this.Close();
                UniversityOfficerHome uoh = new UniversityOfficerHome();
                uoh.Show();

                this.selectForm = 0;
            }
        }
示例#4
0
        // // // // // // //             End Security Officer Login             // // // // // // //



        // // // // // // //             Begining University Officer Login             // // // // // // //



        private void btnUOLogin_MouseClick(object sender, MouseEventArgs e)
        {
            String uoUsername = txtUOUser.Text;
            String uoPassword = txtUOPass.Text;



            try
            {
                connect.Open();


                if (txtUOUser.Text == "" || txtUOPass.Text == "")
                {
                    MessageBox.Show("Fill All The Columns Username and Password...!");
                }
                else
                {
                    //Select USER_TYPE_ID and PASSWORD from USER table
                    String          selectQuery1 = "SELECT USER_TYPE_ID, PASSWORD, U_ID, S_STATE FROM USER WHERE USERNAME='******'";
                    MySqlCommand    command1     = new MySqlCommand(selectQuery1, connect);
                    MySqlDataReader myReader1    = command1.ExecuteReader();

                    while (myReader1.Read())
                    {
                        this.usertype = myReader1[0].ToString();
                        this.password = myReader1[1].ToString();
                        this.uid      = myReader1[2].ToString();
                        this.state    = myReader1[3].ToString();
                    }

                    intUsertype  = int.Parse(usertype);
                    Login.intUid = int.Parse(uid);
                    intState     = int.Parse(state);
                    myReader1.Close();

                    if (intUsertype == 2 && password == uoPassword && intState == 1)
                    {
                        txtUOUser.Text = "";
                        txtUOPass.Text = "";

                        this.intUsertype = 0;
                        this.password    = null;
                        this.uid         = null;
                        Login.intUid     = 0;
                        this.state       = null;
                        this.intState    = 0;

                        this.Hide();
                        UniversityOfficerHome soh = new UniversityOfficerHome();
                        soh.Show();
                    }
                    else
                    {
                        MessageBox.Show("Login Failed.....!!");

                        txtUOUser.Text = "";
                        txtUOPass.Text = "";


                        this.usertype    = null;
                        this.intUsertype = 0;
                        this.password    = null;
                        this.uid         = null;
                        Login.intUid     = 0;
                        this.state       = null;
                        this.intState    = 0;
                    }
                }
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            finally
            {
                connect.Close();
            }
        }