private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         Animal currentanimal = Administration.FindAnimal(Convert.ToInt32(comboBoxFindAnimal.Text));
         if (currentanimal != null)
         {
             MessageBox.Show(currentanimal.ToString());
         }
     }
     catch { }
 }
Beispiel #2
0
        /// <summary>
        /// Show the info of the animal referenced by the 'animal' field.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void showInfoButton_Click(object sender, EventArgs e)
        {
            Animal a = admin.FindAnimal(Convert.ToInt32(nudFindAnimal.Value));

            if (a != null)
            {
                MessageBox.Show(a.ToString());
            }
            else
            {
                MessageBox.Show("die diertje is nie echt bruh");
            }
        }
        private void btnFindAnimal_Click(object sender, EventArgs e)
        {
            int result;

            if (Int32.TryParse(tbFindAnimal.Text, out result))
            {
                lblFindAnimalResult.Text = Administration.FindAnimal(result).ToString();
                RefreshForm = Refreshes.EnumReserveAnimal;
                RefreshFormInputFields(RefreshForm);
            }
            else
            {
                MessageBox.Show("U heeft geen geldig chip registratie nummer ingevoerd");
            }
        }
        private void IsReserved(bool isReserved)
        {
            Animal animal = Administration.FindAnimal((int)nudChipRegistrationNumber.Value);

            if (animal != null)
            {
                if (isReserved == true)
                {
                    animal.IsReserved = true;
                }
                else
                {
                    animal.IsReserved = false;
                }
            }
        }
        private void tbSearchWithChipnumber_TextChanged(object sender, EventArgs e)
        {
            int    chipnummer;
            Animal foundAnimal    = null;
            string chipNumberText = tbSearchWithChipnumber.Text;

            if (int.TryParse(chipNumberText, out chipnummer))
            {
                foundAnimal = administration.FindAnimal(chipnummer);
            }
            lbFound.Items.Clear();
            if (foundAnimal != null)
            {
                lbFound.Items.Add(foundAnimal);
            }
        }