Example #1
0
        private void addButton1_Click(object sender, EventArgs e)
        {
            FruitTypeForm ftf = new FruitTypeForm(FruitTypeForm.MODE.ADD);

            if (ftf.ShowDialog() == DialogResult.OK)
            {
                getFruitType();
            }
        }
Example #2
0
 private void updateButton2_Click(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count == 1)
     {
         FruitTypeForm ftf = new FruitTypeForm(FruitTypeForm.MODE.EDIT, Convert.ToInt32(dataGridView1.SelectedRows[0].Cells[0].Value), (string)dataGridView1.SelectedRows[0].Cells[1].Value);
         if (ftf.ShowDialog() == DialogResult.OK)
         {
             getFruitType();
         }
     }
 }