private void Update_String() { if (identify == "othody") { Othody othody = new Othody(MySqlOperations, MySqlQueries, dataGridView1.SelectedRows[0].Cells[0].Value.ToString()); othody.button3.Visible = true; othody.button1.Visible = false; othody.textBox1.Text = dataGridView1.SelectedRows[0].Cells[1].Value.ToString(); MySqlOperations.Search_In_ComboBox(dataGridView1.SelectedRows[0].Cells[2].Value.ToString(), othody.comboBox2); MySqlOperations.Search_In_ComboBox(dataGridView1.SelectedRows[0].Cells[3].Value.ToString(), othody.comboBox1); othody.AcceptButton = othody.button3; othody.ShowDialog(); MySqlOperations.Select_DataGridView(MySqlQueries.Select_Othody, dataGridView1); } else if (identify == "sotrudniki") { Sotrudniki sotrudniki = new Sotrudniki(MySqlOperations, MySqlQueries, dataGridView1.SelectedRows[0].Cells[0].Value.ToString()); sotrudniki.button3.Visible = true; sotrudniki.button1.Visible = false; sotrudniki.textBox1.Text = dataGridView1.SelectedRows[0].Cells[1].Value.ToString().Split(' ')[0]; sotrudniki.textBox2.Text = dataGridView1.SelectedRows[0].Cells[1].Value.ToString().Split(' ')[1]; sotrudniki.textBox3.Text = dataGridView1.SelectedRows[0].Cells[1].Value.ToString().Split(' ')[2]; MySqlOperations.Search_In_ComboBox(dataGridView1.SelectedRows[0].Cells[2].Value.ToString(), sotrudniki.comboBox1); sotrudniki.textBox4.Text = dataGridView1.SelectedRows[0].Cells[3].Value.ToString(); sotrudniki.AcceptButton = sotrudniki.button3; sotrudniki.ShowDialog(); MySqlOperations.Select_DataGridView(MySqlQueries.Select_Sotrudniki, dataGridView1); } else if (identify == "otdely") { Otdely otdely = new Otdely(MySqlOperations, MySqlQueries, dataGridView1.SelectedRows[0].Cells[0].Value.ToString()); otdely.button3.Visible = true; otdely.button1.Visible = false; otdely.textBox1.Text = dataGridView1.SelectedRows[0].Cells[1].Value.ToString(); otdely.AcceptButton = otdely.button3; otdely.ShowDialog(); MySqlOperations.Select_DataGridView(MySqlQueries.Select_Otdely, dataGridView1); } else if (identify == "organizacii") { Organizacii organizacii = new Organizacii(MySqlOperations, MySqlQueries, dataGridView1.SelectedRows[0].Cells[0].Value.ToString()); organizacii.button3.Visible = true; organizacii.button1.Visible = false; organizacii.textBox1.Text = dataGridView1.SelectedRows[0].Cells[1].Value.ToString(); organizacii.AcceptButton = organizacii.button3; organizacii.ShowDialog(); MySqlOperations.Select_DataGridView(MySqlQueries.Select_Organizacii, dataGridView1); } }
private void Insert_String() { if (identify == "othody") { Othody othody = new Othody(MySqlOperations, MySqlQueries, null); othody.button1.Visible = true; othody.button3.Visible = false; othody.AcceptButton = othody.button1; othody.ShowDialog(); MySqlOperations.Select_DataGridView(MySqlQueries.Select_Othody, dataGridView1); } else if (identify == "sotrudniki") { Sotrudniki sotrudniki = new Sotrudniki(MySqlOperations, MySqlQueries, null); sotrudniki.button1.Visible = true; sotrudniki.button3.Visible = false; sotrudniki.AcceptButton = sotrudniki.button1; sotrudniki.ShowDialog(); MySqlOperations.Select_DataGridView(MySqlQueries.Select_Sotrudniki, dataGridView1); } else if (identify == "otdely") { Otdely otdely = new Otdely(MySqlOperations, MySqlQueries, null); otdely.button1.Visible = true; otdely.button3.Visible = false; otdely.AcceptButton = otdely.button1; otdely.ShowDialog(); MySqlOperations.Select_DataGridView(MySqlQueries.Select_Otdely, dataGridView1); } else if (identify == "organizacii") { Organizacii organizacii = new Organizacii(MySqlOperations, MySqlQueries, null); organizacii.button1.Visible = true; organizacii.button3.Visible = false; organizacii.AcceptButton = organizacii.button1; organizacii.ShowDialog(); MySqlOperations.Select_DataGridView(MySqlQueries.Select_Organizacii, dataGridView1); } }