public void InsertDeadAnimals(Animalpar model)
        {
            int num = 0;
            foreach (var b in batches.GetAll())
            {
                if (model.AniCode.Substring(0,2)==model.BatchTypeDesc.Substring(0,2))
                {
                    num = b.NumOfAnimals - 1;
                }
            }

            using (var x = new DeadAnimalRepository())
            {

                var deadAnimals = new DeadAnimal
                {

                    AnimalId = model.AnimalId,
                    AniCode = model.AniCode,
                    BatchTypeid = bat.GetAll().Find(y => y.BatchTypeDesc == model.BatchTypeDesc).BatchTypeid,
                    AniColor = model.AniColor,
                    AniFeedingStatus = model.AniFeedingStatus,
                    AniAge = model.AniAge,
                    AniGender = model.AniGender,
                    AniHealthStatus = "Dead",
                    AniCurrentCost = model.AniCurrentCost,
                    AniSaleStatus = model.AniSaleStatus,
                    AniTotCost = 0,
                    AnimalValue = 0,
                    //deathCause = model.deathCause,
                };
                x.Insert(deadAnimals);

            }
        }
 public void Insert(DeadAnimal model)
 {
     _deadAnimalRepository.Insert(model);
 }
 public void Update(DeadAnimal model)
 {
     _deadAnimalRepository.Update(model);
 }
 public void Delete(DeadAnimal model)
 {
     _deadAnimalRepository.Delete(model);
 }