Пример #1
0
Файл: zoo.cs Проект: ztgz/MyZoo
        private void animalAddBTN_Click(object sender, EventArgs e)
        {
            //Get weight of animal
            decimal.TryParse(weightAddTextBox.Text, out decimal weight);

            //Get Id of parents
            int.TryParse(parent1ComboBox.Text, out int parent1);
            int.TryParse(parent2ComboBox.Text, out int parent2);

            //Add the animal
            _dataAccess.AddAnimal(speciesComboBox.Text, weight, parent1, parent2);

            //resert the text box
            weightAddTextBox.Text = "";

            //Reload species
            LoadSpecies();

            //Make new search in searchbox
            Search();
        }