コード例 #1
0
 public void DeadAnimalDetails(DeadAnimalView model)
 {
     using (var animal = new DeadAnimalRepository())
     {
         DeadAnimal ani = animal.GetById(model.AnimalId);
     }
 }
コード例 #2
0
 public void DeleteDeadAnimals(int id)
 {
     using (var deadAnimal = new DeadAnimalRepository())
     {
         DeadAnimal anima = deadAnimal.GetById(id);
         if (anima != null)
         {
             deadAnimal.Delete(anima);
         }
     }
 }
コード例 #3
0
 public void UpdateDeadAnimals(Animalpar model)
 {
     using (var animal = new DeadAnimalRepository())
     {
         DeadAnimal ani = animal.GetById(model.AnimalId);
         if (ani != null)
         {
             ani.AnimalId = model.AnimalId;
             ani.AniCode = model.AniCode;
             //ani.b = model.BatchTypeDesc;
             ani.AniColor = model.AniColor;
             ani.AniFeedingStatus = model.AniFeedingStatus;
             ani.AniAge = model.AniAge;
             ani.AniGender = model.AniGender;
             ani.AniHealthStatus = model.AniHealthStatus;
             ani.AniCurrentCost = model.AniCurrentCost;
             ani.AniSaleStatus = model.AniSaleStatus;
             ani.AniTotCost = model.AniTotCost;
             ani.AnimalValue = model.AnimalValue;
             animal.Update(ani);
         }
     }
 }
コード例 #4
0
        public Animalpar GetDeadById(int id)
        {
            using (var animal = new DeadAnimalRepository())
            {
                DeadAnimal ani = animal.GetById(id);
                var anView = new Animalpar();
                if (ani != null)
                {
                    anView.AnimalId = ani.AnimalId;
                    anView.AniCode = ani.AniCode;
                    anView.BatchTypeDesc = bat.GetAll().Find(y => y.BatchTypeid == ani.BatchTypeid).BatchTypeDesc;
                    anView.AniColor = ani.AniColor;
                    anView.AniFeedingStatus = ani.AniFeedingStatus;
                    anView.AniAge = ani.AniAge;
                    anView.AniGender = ani.AniGender;
                    anView.AniHealthStatus = ani.AniHealthStatus;
                    anView.AniCurrentCost = ani.AniCurrentCost;
                    anView.AniSaleStatus = ani.AniSaleStatus;
                    anView.AniTotCost = ani.AniTotCost;
                    anView.AnimalValue = ani.AnimalValue;

                }
                return anView;
            }
        }