public void MakePublic(int id, bool isPublic)
        {
            ActionBenefit ab = _actionBenefitRepository.GetActionBenefitById(id);

            if (ab == null)
            {
                throw new ArgumentException("Action&Benefit not found");
            }

            ab.IsPublic = isPublic;
            UpdateActionBenefit(ab);
        }
        public void CreateActionBenefit(string exchangeName, ActionBenefitMessage message)
        {
            PharmacySystem p = _pharmacyRepo.GetPharmacyByExchangeName(exchangeName);

            if (p == null)
            {
                throw new ArgumentNullException("There is no pharmacy with that exchange!");
            }
            if (message == null)
            {
                throw new ArgumentNullException("Message can not be null!");
            }

            ActionBenefit ab = new ActionBenefit(p.Id, message);

            CreateActionBenefit(ab);
        }
 public void UpdateActionBenefit(ActionBenefit ab)
 {
     _actionBenefitRepository.UpdateActionBenefit(ab);
 }
 public void CreateActionBenefit(ActionBenefit ab)
 {
     _actionBenefitRepository.CreateActionBenefit(ab);
 }
Exemple #5
0
 public void UpdateActionBenefit(ActionBenefit ab)
 {
     _context.Update(ab);
     _context.SaveChanges();
 }
Exemple #6
0
 public void CreateActionBenefit(ActionBenefit ab)
 {
     _context.ActionsBenefits.Add(ab);
     _context.SaveChanges();
 }