Пример #1
0
        private void editParentsBTN_Click(object sender, EventArgs e)
        {
            //Edit parents
            if (_dataAccess.EditParents(animalId, int.Parse(parent1ComboBox.Text),
                                        int.Parse(parent2ComboBox.Text)))
            {
                succesLabel.Text = "Parents were selected.";
            }
            else
            {
                succesLabel.Text = "Parents could not be selected.";
            }

            //reload the search box
            zoo.Search();
        }
Пример #2
0
        private void editAnimalBTN_Click(object sender, EventArgs e)
        {
            //Try to get weight from combo box
            decimal.TryParse(weightAddTextBox.Text, out decimal weight);

            //Edit animal
            if (_dataAccess.EditAnimal(animalId, speciesComboBox.Text, weight))
            {
                infoLabel.Text = "Animal successfully edited.";
            }
            else
            {
                infoLabel.Text = "Edit failed.";
            }

            //Refresh the zoo search list
            zoo.Search();
        }
Пример #3
0
        private void editSpeciesBTN_Click(object sender, EventArgs e)
        {
            //Edit specie
            if (_dataAccess.EditSpecies(speciesNameTextBox.Text, enviormentComboBox.Text, foodTypeComboBox.Text,
                                        countryTextBox.Text))
            {
                infoLabel.Text = speciesNameTextBox.Text + " were succesfully edited.";

                //Reload species in zoo form
                zoo.LoadSpecies();

                //Reload search results in zoo form
                zoo.Search();
            }
            else
            {
                infoLabel.Text = speciesNameTextBox.Text + " edit failed.";
            }
        }