private void Delete_String() { if (MessageBox.Show("Желаете удалить выбранную запись(-и)?", "Вопрос", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { if (identify == "wait_zakaz") { for (int i = 0; i < dataGridView1.SelectedRows.Count; i++) { MySqlOperations.Delete(MySqlQueries.Delete_Zakaz, dataGridView1.SelectedRows[i].Cells[0].Value.ToString()); } MySqlOperations.Select_DataGridView(MySqlQueries.Select_Wait_Zakaz_2, dataGridView1, ID_Org); } else if (identify == "all_zakaz") { for (int i = 0; i < dataGridView1.SelectedRows.Count; i++) { MySqlOperations.Delete(MySqlQueries.Delete_Zakaz, dataGridView1.SelectedRows[i].Cells[0].Value.ToString()); } MySqlOperations.Select_DataGridView(MySqlQueries.Select_All_Zakaz_2, dataGridView1, ID_Org); } else if (identify == "done_zakaz") { for (int i = 0; i < dataGridView1.SelectedRows.Count; i++) { MySqlOperations.Delete(MySqlQueries.Delete_Zakaz, dataGridView1.SelectedRows[i].Cells[0].Value.ToString()); } MySqlOperations.Select_DataGridView(MySqlQueries.Select_Done_Zakaz_2, dataGridView1, ID_Org); } } }
private void button3_Click(object sender, EventArgs e) { for (int i = 0; i < dataGridView1.SelectedRows.Count; i++) { MySqlOperations.Delete(MySqlQueries.Delete_Sostav_Zakaza, dataGridView1.SelectedRows[i].Cells[0].Value.ToString()); } MySqlOperations.Select_DataGridView(MySqlQueries.Select_Sostav_CUP, dataGridView1, ID_Zakaza); }
private void Delete_String() { if (MessageBox.Show("Желаете удалить выбранную запись(-и)?", "Вопрос", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { if (identify == "sklad") { for (int i = 0; i < dataGridView1.SelectedRows.Count; i++) { MySqlOperations.Delete(MySqlQueries.Delete_Sklad, dataGridView1.SelectedRows[i].Cells[0].Value.ToString()); } MySqlOperations.Select_DataGridView(MySqlQueries.Select_Sklad, dataGridView1); } else if (identify == "product") { for (int i = 0; i < dataGridView1.SelectedRows.Count; i++) { MySqlOperations.Delete(MySqlQueries.Delete_Product, dataGridView1.SelectedRows[i].Cells[0].Value.ToString()); } MySqlOperations.Select_DataGridView(MySqlQueries.Select_Product, dataGridView1); } else if (identify == "organizacii") { for (int i = 0; i < dataGridView1.SelectedRows.Count; i++) { MySqlOperations.Delete(MySqlQueries.Delete_Organizacii, dataGridView1.SelectedRows[i].Cells[0].Value.ToString()); } MySqlOperations.Select_DataGridView(MySqlQueries.Select_Organizacii, dataGridView1); } else if (identify == "zayavka") { for (int i = 0; i < dataGridView1.SelectedRows.Count; i++) { MySqlOperations.Delete(MySqlQueries.Delete_Zayavka, dataGridView1.SelectedRows[i].Cells[0].Value.ToString()); } MySqlOperations.Select_DataGridView(MySqlQueries.Select_Zayavka, dataGridView1); } } }