コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            db_connect();
            OracleCommand cum = new OracleCommand();

            cum.Connection  = conn;
            cum.CommandText = "insert into Painting (P_name,Price,Year,Artist_id) values('" + textBox2.Text + "','" + textBox3.Text + "','" + textBox1.Text + "','" + textBox4.Text + "')";
            cum.CommandType = CommandType.Text;
            cum.ExecuteNonQuery();
            String pname = textBox2.Text;

            comm             = new OracleCommand();
            comm.CommandText = "select P_id from Painting where P_name ='" + pname + "'";
            comm.CommandType = CommandType.Text;
            da = new OracleDataAdapter(comm.CommandText, conn);
            dt = new DataTable();
            da.Fill(dt);
            int t = dt.Rows.Count;

            dr = dt.Rows[i];
            string pid = dr["P_id"].ToString();

            cum.Connection  = conn;
            cum.CommandText = "insert into Adds values(" + pid + "," + id + ", SYSDATE)";
            cum.CommandType = CommandType.Text;
            cum.ExecuteNonQuery();

            MessageBox.Show("Painting Added!!");
            conn.Close();
            this.Hide();
            Form mpf = new MProfile(id);

            mpf.Show();
        }
コード例 #2
0
ファイル: Stats.cs プロジェクト: manojkun/dbs
        private void button1_Click(object sender, EventArgs e)
        {
            Form k = new MProfile(id);

            k.Show();
            this.Close();
        }
コード例 #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            db_connect();
            comm             = new OracleCommand();
            comm.CommandText = "select * from Manager where manager_id='" + textBox1.Text + "' and Password='******'";
            comm.CommandType = CommandType.Text;
            da = new OracleDataAdapter(comm.CommandText, conn);
            dt = new DataTable();
            da.Fill(dt);
            int t = dt.Rows.Count;

            if (t == 1)
            {
                DialogResult dr = MessageBox.Show("Logged in Successfully");
                if (dr == DialogResult.OK)
                {
                    Form lg = new MProfile(textBox1.Text);
                    this.Close();
                    lg.Show();
                }
            }
            else
            {
                DialogResult dr = MessageBox.Show("Login Failed , Please Try Again");
                textBox1.Text = String.Empty;
                textBox2.Text = String.Empty;
            }
        }
コード例 #4
0
        private void button4_Click(object sender, EventArgs e)
        {
            db_connect();
            OracleCommand cum = new OracleCommand();

            cum.Connection  = conn;
            cum.CommandText = "insert into Cleaner (cl_name,phone,manager_id) values('" + textBox2.Text + "','" + textBox3.Text + "','" + id + "')";
            cum.CommandType = CommandType.Text;
            cum.ExecuteNonQuery();
            MessageBox.Show("Cleaner Employed");
            conn.Close();
            this.Hide();
            Form pf = new MProfile(id);

            pf.Show();
        }