private void btnDelete_Click(object sender, EventArgs e)
        {
            Animal animal = (Animal)listNotReserved.SelectedItem;

            if (animal != null && administration.RemoveAnimal(animal.ChipRegistrationNumber))
            {
                FillLists();
            }
        }
Ejemplo n.º 2
0
 private void DeleteAnimal(Animal animal)
 {
     if (administration.RemoveAnimal(animal.ChipRegistrationNumber))
     {
         administration.RemoveAnimal(animal.ChipRegistrationNumber);
         listUnReserved.Items.Remove(cbAnimal.SelectedItem);
         listReserved.Items.Remove(cbAnimal.SelectedItem);
         cbAnimal.Items.Remove(cbAnimal.SelectedItem);
         UpdateGUI();
     }
 }
Ejemplo n.º 3
0
 private void btnDeleteSelectedAnimal_Click(object sender, EventArgs e)
 {
     if (lbNotReserved.SelectedItem != null)
     {
         Animal a = (Animal)lbNotReserved.SelectedItem;
         admin.RemoveAnimal(a.ChipRegistrationNumber);
     }
     if (lbIsReserved.SelectedItem != null)
     {
         Animal a = (Animal)lbIsReserved.SelectedItem;
         admin.RemoveAnimal(a.ChipRegistrationNumber);
     }
     lbIsReserved.Items.Remove(lbIsReserved.SelectedItem);
     lbNotReserved.Items.Remove(lbNotReserved.SelectedItem);
     lbIsReserved.Update();
     lbNotReserved.Update();
 }
Ejemplo n.º 4
0
        private void ButtonReserve_Click(object sender, EventArgs e)
        {
            //Vraag: mag je voor het reserveren in de class van Administration een extra methode aanmaken?

            try
            {
                Animal currentAnimal = listBoxAnimalsNotReserved.SelectedItem as Animal;
                Administration.RemoveAnimal(currentAnimal.ChipRegistrationNumber);
                currentAnimal.IsReserved = true;
                if (Administration.Add(currentAnimal) == true)
                {
                    MessageBox.Show("Reserved!");
                }
                UpdateListbox();
            }
            catch { }
        }
Ejemplo n.º 5
0
        private void btnDelete_Click(object sender, EventArgs e)
        {
            int result;

            if (Int32.TryParse(nudChipRegistrationNumber.Text, out result))
            {
                Administration.RemoveAnimal(result);
                RefreshForm = Refreshes.EnumReserveAnimal;
                RefreshFormInputFields(RefreshForm);
            }
            else
            {
                MessageBox.Show("U heeft geen geldig chip registratie nummer ingevoerd");
            }
        }