Ejemplo n.º 1
0
        public void InsertAnimal(Animal anAnimal)
        {
            AnimalHealthRepository myAnimalHealth = new AnimalHealthRepository();
            AnimalTraitRepository  myAnimalTraits = new AnimalTraitRepository();

            InsertIntoAnimal(anAnimal);
            GetAnimalId(anAnimal);
            myAnimalTraits.InsertIntoAnimalTraits(anAnimal);
            myAnimalHealth.InsertIntoAnimalHealth(anAnimal);
        }
Ejemplo n.º 2
0
        public void GiveShot(int animalId)
        {
            Animal thisAnimal = ourAnimals.Where(a => a.AnimalId == animalId).Select(a =>
            {
                a.ThisHealth.ShotsDate = DateTime.Now;
                a.ThisHealth.HadShots  = true;
                return(a);
            }).Single();
            AnimalHealthRepository health = new AnimalHealthRepository();

            health.UpdateAnimalShot(thisAnimal);
        }