private void addButton7_Click(object sender, EventArgs e) { if (dataGridView2.SelectedRows.Count == 1) { FruitPriceForm fpf = new FruitPriceForm(FruitTypeForm.MODE.ADD, Convert.ToInt32(dataGridView2.SelectedRows[0].Cells[0].Value), (string)dataGridView2.SelectedRows[0].Cells[1].Value); if (fpf.ShowDialog() == DialogResult.OK) { getFruitPrice(); } } }
private void updateButton8_Click(object sender, EventArgs e) { if (dataGridView3.SelectedRows.Count == 1) { FruitPriceForm fpf = new FruitPriceForm(FruitTypeForm.MODE.EDIT, Convert.ToInt32(dataGridView3.SelectedRows[0].Cells[0].Value), (float)Convert.ToDouble(dataGridView3.SelectedRows[0].Cells[1].Value), (float)Convert.ToDouble(dataGridView3.SelectedRows[0].Cells[2].Value), (string)dataGridView3.SelectedRows[0].Cells[3].Value); if (fpf.ShowDialog() == DialogResult.OK) { getFruitPrice(); } } }