Example #1
0
 public void UpdateBenefit(BenefitView model)
 {
     using (var prepo = new BenefitRepository())
     {
         Benefit p = prepo.GetById(model.benefitID);
         if (p != null)
         {
             p.Name = model.Name;
             prepo.Update(p);
         }
     }
 }
Example #2
0
        public BenefitView GetBenefitById(int id)
        {
            using (var b = new BenefitRepository())
            {
                Benefit ben   = b.GetById(id);
                var     model = new BenefitView();

                if (ben != null)
                {
                    model.benefitID = ben.benefitID;
                    model.Name      = ben.Name;
                }
                return(model);
            }
        }