Beispiel #1
0
        private void bunifuTileButton3_Click(object sender, EventArgs e)
        {
            conn.Close();
            this.Hide();
            ReserveRoom a = new ReserveRoom();

            a.ShowDialog();
            this.Close();
        }
Beispiel #2
0
        private void bunifuPictureBox2_Click(object sender, EventArgs e)
        {
            FeedBackConnection.Close();
            this.Hide();
            ReserveRoom a = new ReserveRoom();

            a.ShowDialog();
            this.Close();
        }
Beispiel #3
0
        private void bunifuFlatButton2_Click(object sender, EventArgs e)
        {
            if (check() == true)
            {
                return;
            }
            if (validate() == true)
            {
                return;
            }
            OracleCommand cmd = new OracleCommand();

            cmd.Connection  = conn;
            cmd.CommandText = "insert into users( id,email, gender, date_of_birth, first_name, last_name, mobile, password, is_admin) values(:id,:email,:gender,:dateofbirth, :firstname, :lastname, :mobile, :password,'f') ";
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Add("id", getuserID());
            cmd.Parameters.Add("email", email.Text);
            if (f.Checked)
            {
                cmd.Parameters.Add("gender", 'f');
            }
            else
            {
                cmd.Parameters.Add("gender", 'm');
            }
            cmd.Parameters.Add("dateofbirth", dateofbirth.Value);
            cmd.Parameters.Add("firstname", first.Text);
            cmd.Parameters.Add("lastname", last.Text);
            cmd.Parameters.Add("mobile", mobile.Text);
            cmd.Parameters.Add("password", password.Text);

            int r = cmd.ExecuteNonQuery();

            if (r > 0)
            {
                MessageBox.Show("Registeration Completed!");
            }

            conn.Close();
            this.Hide();
            ReserveRoom a = new ReserveRoom();

            a.ShowDialog();
            this.Close();
        }
Beispiel #4
0
        private void LoginBtn_Click(object sender, EventArgs e)
        {
            string        cmdst = "select * from Users where EMAIL=:email AND PASSWORD=:password ";
            OracleCommand cmd   = new OracleCommand();

            cmd.Connection  = conn;
            cmd.CommandText = cmdst;
            cmd.CommandType = CommandType.Text;
            cmd.Parameters.Add("email", EmailTxtBox.Text);
            cmd.Parameters.Add("password", PasswordTxtBox.Text);
            OracleDataReader rd = cmd.ExecuteReader();



            if (rd.Read())
            {
                MessageBox.Show(" You Have Logged In Successfully");
                userID = rd["id"].ToString();
                if (rd["is_admin"].ToString() == "t")
                {
                    conn.Close();
                    Admin temp = new Admin();
                    this.Hide();
                    temp.ShowDialog();
                    this.Close();
                }
                else
                {
                    conn.Close();
                    ReserveRoom temp = new ReserveRoom();
                    this.Hide();
                    temp.ShowDialog();
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Wrong email or password");
            }
        }