Beispiel #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            User_Options ob = new User_Options();

            ob.Show();
            this.Hide();
        }
        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "" || textBox2.Text == "")
            {
                MessageBox.Show("Fill up all the fields for Login");
                return;
            }

            try
            {
                connection CN = new connection();
                CN.thisConnection.Open();
                OracleCommand thisCommand = new OracleCommand();
                thisCommand.Connection  = CN.thisConnection;
                thisCommand.CommandText = "SELECT * FROM New_User_SignIn WHERE username='******' AND password='******'";
                OracleDataReader thisReader = thisCommand.ExecuteReader();

                if (thisReader.Read())
                {
                    User_Options oform = new User_Options();
                    oform.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("username or password incorrect");
                }
                CN.thisConnection.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #3
0
        private void button6_Click(object sender, EventArgs e)
        {
            connection sv = new connection();

            sv.thisConnection.Open();
            OracleCommand thisCommand = sv.thisConnection.CreateCommand();

            thisCommand.CommandText = "update New_User_SignIn set email = '" + textBox1.Text + "',mobile= '" + textBox2.Text + "'where password= '******'";

            thisCommand.Connection  = sv.thisConnection;
            thisCommand.CommandType = CommandType.Text;



            try
            {
                int a = thisCommand.ExecuteNonQuery();
                if (a == 1)
                {
                    MessageBox.Show("Updated Successfully");
                }
                else
                {
                    MessageBox.Show("Not Updated...Insert your old Password Perfectly");
                    return;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Not Updated");
            }

            sv.thisConnection.Close();
            this.Close();

            User_Options ob = new User_Options();

            ob.Show();
            this.Hide();
        }