Example #1
0
        public void UpdateSpecialty(SpecialtyBuilder builder)
        {
            var specialty = builder.Build();

            if (Notification.HasNotification())
            {
                return;
            }

            if (!_specialtyRepository.ExistsSpecialty(specialty.Id))
            {
                Notification.Raise(NotificationEvent.DefaultBuilder
                                   .WithNotFoundStatus()
                                   .WithMessage(AppConsts.LocalizationSourceName, Specialty.Error.CouldNotFindSpecialty)
                                   .Build());
            }

            if (!Notification.HasNotification())
            {
                _specialtyRepository.UpdateSpecialty(specialty);
            }
        }
Example #2
0
        public int CreateSpecialty(SpecialtyBuilder builder)
        {
            var specialty = builder.Build();

            return(Notification.HasNotification() ? 0 : _specialtyRepository.CreateSpecialty(specialty));
        }