Example #1
0
        public Form4()
        {
            viewtable Table = new viewtable();

            InitializeComponent();
            dataGridView1.DataSource = Table.GetTableTheater();
        }
Example #2
0
 private void button2_Click(object sender, EventArgs e)
 {
     {
         try
         {
             viewtable R = new viewtable();
             string    id;
             string    fname;
             string    strDb;
             strDb = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Database.accdb;" + "Persist Security Info=False";
             OleDbConnection conn = new OleDbConnection(strDb);
             conn.Open();
             OleDbCommand cmd = conn.CreateCommand();
             id              = textBox4.Text;
             fname           = textBox3.Text;
             cmd.CommandText = "update vip set fname='" + fname + "' where מזהה=" + id + "";
             int n = cmd.ExecuteNonQuery();
             MessageBox.Show("update " + n.ToString() + " row");
             dataGridView1.DataSource = R.GetTablevip();
             conn.Close();
         }
         catch (Exception err)
         {
             MessageBox.Show(err.Message);
         }
     }
 }
Example #3
0
        public Form3()
        {
            viewtable Table = new viewtable();

            InitializeComponent();
            DataGridView.DataSource  = Table.GetTabledata();
            dataGridView1.DataSource = Table.GetTablevip();
        }
Example #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            viewtable Table = new viewtable();
            SitSelect SS    = new SitSelect();

            SS.GetSit(Line, Colmn);
            dataGridView1.DataSource = Table.GetTableTheater();
            countseats += "" + Line + "" + Colmn + "";
            stop--;
            if (stop == 0)
            {
                MessageBox.Show("הזמנת" + sum + "כסאות התקבלה לחץ על המשך");
            }
        }
Example #5
0
 private void button3_Click(object sender, EventArgs e)
 {
     {
         viewtable Table = new viewtable();
         for (int i = 1; i <= 5; i++)
         {
             try
             {
                 string seats;
                 string strDb;
                 int    j = 0;
                 seats = "D";
                 strDb = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Database.accdb;" + "Persist Security Info=False";
                 OleDbConnection conn = new OleDbConnection(strDb);
                 conn.Open();
                 OleDbCommand cmd = conn.CreateCommand();
                 cmd.CommandText = "update Theater set " + i + "='" + j.ToString() + "' where seats='" + seats + "'";
                 int n = cmd.ExecuteNonQuery();
                 conn.Close();
             }
             catch (Exception err)
             {
                 MessageBox.Show(err.Message);
             }
         }
         for (int i = 1; i <= 5; i++)
         {
             try
             {
                 string seats;
                 string strDb;
                 int    j = 0;
                 seats = "C";
                 strDb = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Database.accdb;" + "Persist Security Info=False";
                 OleDbConnection conn = new OleDbConnection(strDb);
                 conn.Open();
                 OleDbCommand cmd = conn.CreateCommand();
                 cmd.CommandText = "update Theater set " + i + "='" + j.ToString() + "' where seats='" + seats + "'";
                 int n = cmd.ExecuteNonQuery();
                 conn.Close();
             }
             catch (Exception err)
             {
                 MessageBox.Show(err.Message);
             }
         }
         for (int i = 1; i <= 5; i++)
         {
             try
             {
                 string seats;
                 string strDb;
                 int    j = 0;
                 seats = "B";
                 strDb = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Database.accdb;" + "Persist Security Info=False";
                 OleDbConnection conn = new OleDbConnection(strDb);
                 conn.Open();
                 OleDbCommand cmd = conn.CreateCommand();
                 cmd.CommandText = "update Theater set " + i + "='" + j.ToString() + "' where seats='" + seats + "'";
                 int n = cmd.ExecuteNonQuery();
                 conn.Close();
             }
             catch (Exception err)
             {
                 MessageBox.Show(err.Message);
             }
         }
         for (int i = 1; i <= 5; i++)
         {
             try
             {
                 string seats;
                 string strDb;
                 int    j = 0;
                 seats = "A";
                 strDb = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Database.accdb;" + "Persist Security Info=False";
                 OleDbConnection conn = new OleDbConnection(strDb);
                 conn.Open();
                 OleDbCommand cmd = conn.CreateCommand();
                 cmd.CommandText = "update Theater set " + i + "='" + j.ToString() + "' where seats='" + seats + "'";
                 int n = cmd.ExecuteNonQuery();
                 conn.Close();
             }
             catch (Exception err)
             {
                 MessageBox.Show(err.Message);
             }
         }
         MessageBox.Show("הנתונים נמחקו בחר מקומות ישיבה");
         dataGridView1.DataSource = Table.GetTableTheater();
         countseats = null;
     }
 }