private void button1_Click(object sender, EventArgs e)
        {
            enteredUsername = textBox1.Text;
            enteredPassword = textBox2.Text;
            //MessageBox.Show(enteredUsername);
            //MessageBox.Show(enteredPassword);

            conn = new OracleConnection(ordb);
            conn.Open();

            OracleCommand cmd = new OracleCommand();

            cmd.Connection  = conn;
            cmd.CommandType = CommandType.Text;
            if (enteredtype == "Applicants")
            {
                cmd.CommandText = "select * from applicants";
            }
            else if (enteredtype == "Company")
            {
                cmd.CommandText = "select * from company";
            }
            //  cmd.CommandText = "select * from applicants";
            // cmd.CommandType = CommandType.Text;
            userSSN = "";

            //  cmd.CommandText = "select * from applicants";
            OracleDataReader dr = cmd.ExecuteReader();

            while (dr.Read())
            {
                if (enteredUsername == dr[1].ToString() && enteredPassword == dr[4].ToString())
                {
                    userSSN = dr[0].ToString();
                    break;
                }
            }
            if (userSSN != "" && enteredtype == "Applicants")
            {
                //  MessageBox.Show(userSSN);
                applicant_home_page b = new applicant_home_page(userSSN);
                b.Show();
            }
            else if (userSSN != "" && enteredtype == "Company")
            {
                Form2 s = new Form2(userSSN);
                s.Show();
            }
            else
            {
                MessageBox.Show("Wrong Username or Password");
            }
            //button1.Enabled = false;
            //applicant_home_page b = new applicant_home_page();
            //b.Show(); */
        }
        private void button1_Click(object sender, EventArgs e)
        {
            OracleCommand cmd = new OracleCommand();

            cmd.Connection  = conn;
            cmd.CommandText = "insert into applicants values (:ssn,:name,:address,:age,:password)";
            cmd.Parameters.Add("ssn", textBox9.Text);
            cmd.Parameters.Add("name", textBox1.Text);
            cmd.Parameters.Add("address", textBox4.Text);
            cmd.Parameters.Add("age", textBox10.Text);
            cmd.Parameters.Add("password", textBox2.Text);
            int r = cmd.ExecuteNonQuery();

            if (r != -1)
            {
                MessageBox.Show("New user is added");
                applicant_home_page ap = new applicant_home_page(userSSN);
                ap.Show();
            }
        }
Example #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            applicant_home_page home = new applicant_home_page(userssn);

            home.Show();
        }