コード例 #1
0
 public ActionResult Delete(int id)
 {
     var animals=new AnimalBusiness();
     ViewBag.Batchtypeid = new SelectList(_db2.GetAllBatchTypes(), "BatchTypeid", "BatchTypeDesc");
     var anView =ani.GetAnimalById(id);
     ani.DeleteAnimals(anView);
     dead.InsertDeadAnimals(anView);
     return RedirectToAction("GetAllAnimals");
 }
コード例 #2
0
//Method to get number of animals currently in feeding lots
        private static int CalcAniFeeding(FeedingSchemeView model)
        {
            AnimalBusiness aniBl       = new AnimalBusiness();
            BatchTypeBl    batchTypeBl = new BatchTypeBl();
            var            bDesc       = batchTypeBl.GetAllBatchTypes().Find(x => x.BatchTypeid == model.BatchTypeid);

            return(aniBl.GetAllAnimals().Count(animalpar => animalpar.AniFeedingStatus == "FeedLot" &&
                                               animalpar.BatchTypeDesc == bDesc.BatchTypeDesc));
        }
コード例 #3
0
        //Method to get number of animals currently in feeding lots
        private static int CalcAniFeeding(FeedingSchemeView model)
        {
            AnimalBusiness aniBl = new AnimalBusiness();
            BatchTypeBl batchTypeBl = new BatchTypeBl();
            var bDesc = batchTypeBl.GetAllBatchTypes().Find(x=>x.BatchTypeid== model.BatchTypeid);

            return (aniBl.GetAllAnimals().Count(animalpar => animalpar.AniFeedingStatus == "FeedLot"
                         && animalpar.BatchTypeDesc==bDesc.BatchTypeDesc));
        }