Esempio n. 1
0
 private void Insert_String()
 {
     if (identify == "sklad")
     {
         Sklad sklad = new Sklad(MySqlQueries, MySqlOperations);
         sklad.button3.Visible = false;
         sklad.button1.Visible = true;
         sklad.AcceptButton    = sklad.button1;
         sklad.ShowDialog();
         MySqlOperations.Select_DataGridView(MySqlQueries.Select_Sklad, dataGridView1);
     }
     else if (identify == "product")
     {
         Product product = new Product(MySqlQueries, MySqlOperations);
         product.button3.Visible = false;
         product.button1.Visible = true;
         product.AcceptButton    = product.button1;
         product.ShowDialog();
         MySqlOperations.Select_DataGridView(MySqlQueries.Select_Product, dataGridView1);
     }
     else if (identify == "organizacii")
     {
         Organizacii organizacii = new Organizacii(MySqlQueries, MySqlOperations);
         organizacii.button3.Visible = false;
         organizacii.button1.Visible = true;
         organizacii.AcceptButton    = organizacii.button1;
         organizacii.ShowDialog();
         MySqlOperations.Select_DataGridView(MySqlQueries.Select_Organizacii, dataGridView1);
     }
 }
Esempio n. 2
0
 private void Update_String()
 {
     if (dataGridView1.SelectedRows.Count <= 1)
     {
         if (identify == "sklad")
         {
             Sklad sklad = new Sklad(MySqlQueries, MySqlOperations, dataGridView1.SelectedRows[0].Cells[0].Value.ToString());
             sklad.textBox1.Text   = dataGridView1.SelectedRows[0].Cells[1].Value.ToString();
             sklad.button1.Visible = false;
             sklad.button3.Visible = true;
             sklad.AcceptButton    = sklad.button3;
             sklad.ShowDialog();
             MySqlOperations.Select_DataGridView(MySqlQueries.Select_Sklad, dataGridView1);
         }
         else if (identify == "product")
         {
             Product product = new Product(MySqlQueries, MySqlOperations, dataGridView1.SelectedRows[0].Cells[0].Value.ToString());
             MySqlOperations.Search_In_ComboBox(dataGridView1.SelectedRows[0].Cells[3].Value.ToString(), product.comboBox1);
             product.textBox1.Text = dataGridView1.SelectedRows[0].Cells[1].Value.ToString();
             MySqlOperations.Search_In_ComboBox(dataGridView1.SelectedRows[0].Cells[2].Value.ToString(), product.comboBox2);
             product.button1.Visible = false;
             product.button3.Visible = true;
             product.AcceptButton    = product.button1;
             product.ShowDialog();
             MySqlOperations.Select_DataGridView(MySqlQueries.Select_Product, dataGridView1);
         }
         else if (identify == "organizacii")
         {
             Organizacii organizacii = new Organizacii(MySqlQueries, MySqlOperations, dataGridView1.SelectedRows[0].Cells[0].Value.ToString());
             organizacii.textBox1.Text   = dataGridView1.SelectedRows[0].Cells[1].Value.ToString();
             organizacii.textBox2.Text   = dataGridView1.SelectedRows[0].Cells[2].Value.ToString();
             organizacii.button1.Visible = false;
             organizacii.button3.Visible = true;
             organizacii.AcceptButton    = organizacii.button1;
             organizacii.ShowDialog();
             MySqlOperations.Select_DataGridView(MySqlQueries.Select_Organizacii, dataGridView1);
         }
     }
 }