private void добавитьToolStripMenuItem_Click(object sender, EventArgs e) { edit = false; if (label1.Text == "Доступные виды карт") { EditCards edt = new EditCards(); edt.ShowDialog(); BuildInQueries.SQLQuery(bindingNavigator1, dataGridView1, "Select * From CardTypes"); } if (label1.Text == "Выданные карты") { GetCard getCard = new GetCard(); getCard.ShowDialog(); BuildInQueries.SQLQuery(bindingNavigator1, dataGridView1, "Select * From BankCards"); } }
private void изменитьToolStripMenuItem_Click(object sender, EventArgs e) { edit = true; if (label1.Text == "Доступные виды карт") { Id = Convert.ToInt32(dataGridView1[0, dataGridView1.CurrentRow.Index].Value); CardType = dataGridView1[1, dataGridView1.CurrentRow.Index].Value.ToString(); Period = Convert.ToInt32(dataGridView1[2, dataGridView1.CurrentRow.Index].Value); Price1 = Convert.ToDouble(dataGridView1[3, dataGridView1.CurrentRow.Index].Value); Price2 = Convert.ToDouble(dataGridView1[4, dataGridView1.CurrentRow.Index].Value); Amount = Convert.ToDouble(dataGridView1[5, dataGridView1.CurrentRow.Index].Value); EditCards edt = new EditCards(); edt.ShowDialog(); BuildInQueries.SQLQuery(bindingNavigator1, dataGridView1, "Select * From CardTypes"); } else if (label1.Text == "Выданные карты") { MessageBox.Show("Запрещено!"); } }