private void button1_Click(object sender, EventArgs e)
        {
            user1 u = new user1(h);

            u.Show();
            this.Hide();
        }
Esempio n. 2
0
        private void button6_Click(object sender, EventArgs e)
        {
            string connetionString = "Provider=OraOLEDB.Oracle;Data Source=orcl;User Id=bms;Password=bmscse;";

            if (radioButton2.Checked == true)
            {
                String           sql2        = "SELECT username FROM register where username='******'and pwd='" + textBox2.Text + "'";
                OleDbConnection  connection  = new OleDbConnection(connetionString);
                OleDbDataAdapter dataadapter = new OleDbDataAdapter(sql2, connection);
                connection.Open();
                DataTable dt = new DataTable();

                dataadapter.Fill(dt);
                connection.Close();



                if (dt.Rows.Count == 1)
                {
                    string a = textBox1.Text.ToString();
                    user1  u = new user1(a);
                    u.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Incorrect Details");
                }
            }

            else if (radioButton1.Checked == true)
            {
                String           sql3        = "SELECT username FROM admin where username='******'and pwd='" + textBox2.Text + "'";
                OleDbConnection  connection  = new OleDbConnection(connetionString);
                OleDbDataAdapter dataadapter = new OleDbDataAdapter(sql3, connection);
                connection.Open();
                DataTable dt = new DataTable();
                dataadapter.Fill(dt);
                connection.Close();



                if (dt.Rows.Count == 1)
                {
                    admin1 a = new admin1();
                    a.Show();
                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Incorrect Details");
                }
            }
        }
Esempio n. 3
0
      private void button1_Click(object sender, EventArgs e)
      {
          string connetionString = "Provider=OraOLEDB.Oracle;Data Source=orcl;User Id=bms;Password=bmscse;";

          string           sql3        = "SELECT vname FROM media where id='" + b + "'";
          string           f           = CreateReader2(connetionString, sql3);
          string           i           = DateTime.Now.ToShortDateString();
          string           j           = DateTime.Now.ToShortTimeString();
          string           sql2        = "Insert into vhistory  VALUES ('" + b + "', '" + f + "', '" + i + "', '" + j + "', '" + p + "')";
          OleDbConnection  connection  = new OleDbConnection(connetionString);
          OleDbDataAdapter dataadapter = new OleDbDataAdapter(sql2, connection);

          dataadapter.InsertCommand = new OleDbCommand(sql2, connection);
          connection.Open();
          dataadapter.InsertCommand.ExecuteNonQuery();
          connection.Close();
          user1 n = new user1(p);

          n.Show();
          axWindowsMediaPlayer1.Ctlcontrols.stop();
          this.Hide();
      }