Exemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            USER_PROFILE f = new USER_PROFILE();

            f.Show();
            this.Hide();
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "admin" && textBox2.Text == "admin")
            {
                admin_profil f = new admin_profil();
                f.Show();
                this.Hide();
            }
            else
            {
                conn = new OracleConnection(ordb);
                conn.Open();
                OracleCommand cmd      = new OracleCommand();
                string        user_cmd = "select * from USER_INFO where E_MAIL=:mail and PASSWORD=:password";
                string        eng_cmd  = "select * from ENGINEER where E_MAIL=:mail and PASSWORD=:password";
                string        comm     = " ";
                if (user_radioButton1.Checked == true)
                {
                    comm = user_cmd;
                }
                else if (eng_radioButton2.Checked == true)
                {
                    comm = eng_cmd;
                }

                cmd.Connection  = conn;
                cmd.CommandText = comm;
                cmd.CommandType = CommandType.Text;
                cmd.Parameters.Add("mail", textBox1.Text.ToString());
                cmd.Parameters.Add("password", textBox2.Text.ToString());
                OracleDataReader dr = cmd.ExecuteReader();

                if (dr.Read())
                {
                    id = Convert.ToInt32(dr[0]);

                    if (user_radioButton1.Checked == true)
                    {
                        USER_PROFILE f = new USER_PROFILE();
                        f.Show();
                        this.Hide();
                    }
                    if (eng_radioButton2.Checked == true)
                    {
                        ENGINEER_PROFILE f = new ENGINEER_PROFILE();
                        f.Show();
                        this.Hide();
                    }

                    else if (eng_radioButton2.Checked == false && user_radioButton1.Checked == false)
                    {
                        MessageBox.Show("ERROR>>YOU SHOULD SELECT(USER OR ENGINEER)");
                    }
                }

                else
                {
                    MessageBox.Show("invaild data");
                }
                conn.Close();
            }
        }