Ejemplo n.º 1
0
        public void DeletePercent(PercentageView model)
        {
            using (var percRepo = new PercentageRepository())
            {
                Percentage feed = percRepo.GetById(model.FeedingSchemeId);

                if (feed != null)
                {
                    percRepo.Delete(feed);
                }
            }
        }
Ejemplo n.º 2
0
        public PercentagePartialView GetPercView(int id)
        {
            using (var ingreRepo = new PercentageRepository())
            {
                Percentage perc = ingreRepo.GetById(id);

                var ingredView = new PercentagePartialView();

                if (perc != null)
                {
                    ingredView.PercentageId = perc.PercentageId;
                    ingredView.ItemName     =
                        _fStockRepo.GetAll().Find(j => j.FeedingStockId == perc.FeedingStockId).ItemName;
                    ingredView.Percentage = perc.PercentageRate;
                    ingredView.SchemeCode =
                        _fSchemeRepo.GetAll().Find(j => j.FeedingSchemeId == perc.FeedingSchemeId).SchemeCode;
                }
                return(ingredView);
            }
        }