コード例 #1
0
        //redirects to AddEditForm
        private void btnEdit_Click(object sender, EventArgs e)
        {
            using (AddEditForm editForm = new AddEditForm(animal))
            {
                editForm.ShowDialog();
            }

            animal = WebHandeler.getAnimal(animal.id).Item1;
            AnimalForm_Load(sender, e);
        }
コード例 #2
0
        /*
         *  When any cell containing an animal is selected
         */
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            Tuple <Animal, int> selectedAnimal = WebHandeler.getAnimal((int)dgvAnimalList.Rows[e.RowIndex].Cells[0].Value);

            if (selectedAnimal == null)
            {
                return;
            }
            AnimalDetailForm detailForm = new AnimalDetailForm(selectedAnimal.Item1);

            detailForm.ShowDialog();
        }