コード例 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.Hide();
            int x = Int32.Parse(textBox1.Text);

            if (x >= 100 && x < 200 && textBox2.Text == "chef")
            {
                Chef obj1 = new Chef(x);
                obj1.Show();
            }
            else if (x >= 200 && x < 300 && textBox2.Text == "waiter")
            {
                Waiter obj2 = new Waiter(x);
                obj2.Show();
            }
            else if (x >= 300 && x < 400 && textBox2.Text == "cashier")
            {
                Cashier obj3 = new Cashier(x);
                obj3.Show();
            }
            else
            {
                MessageBox.Show("Invalid Username  or password");
                textBox1.Clear();
                textBox2.Clear();
                LogIn l = new LogIn();
                l.Show();
            }
        }
コード例 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            String          query      = "insert into orders values(" + Int32.Parse(textBox1.Text) + ",sysdate," + cid + ",'" + cname + "'," + Int32.Parse(textBox2.Text) + "," + Int32.Parse(textBox3.Text) + "," + Int32.Parse(textBox4.Text) + "," + 0 + ")";
            String          connection = "Provider=OraOLEDB.Oracle;Data Source=localhost;User Id=system;Password=SYSTEM;OLEDB.NET=True";
            String          del        = "delete from customer where cid=" + cid;
            OleDbConnection obj1       = new OleDbConnection(connection);

            try
            {
                obj1.Open();
                OleDbCommand cm3 = new OleDbCommand(query, obj1);
                cm3.ExecuteNonQuery();
                obj1.Close();
                obj1.Open();
                OleDbCommand cm2 = new OleDbCommand(del, obj1);
                cm2.ExecuteNonQuery();
                MessageBox.Show("Order taken successfully");
                obj1.Close();

                Waiter w = new Waiter(wid);
                w.Show();
                this.Hide();
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
            }
        }
コード例 #3
0
ファイル: Insert.cs プロジェクト: frankdsouza55/SMBD
 private void button2_Click(object sender, EventArgs e)
 {
     if (eid == 200)
     {
         Waiter w = new Waiter(eid);
         this.Close();
         w.Show();
     }
     else if (eid == 300)
     {
         Cashier c = new Cashier(eid);
         this.Close();
         c.Show();
     }
     else if (eid == 100)
     {
         Chef ch = new Chef(eid);
         this.Close();
         ch.Show();
     }
 }