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)
        {
            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 #3
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;
     }
 }