Exemple #1
0
 public IActionResult Post(RegistrationInPharmacyDto dto)
 {
     if (RegistrationInPharmacyService.Create(dto) == null)
     {
         return(BadRequest());
     }
     return(Ok());
 }
        public RegistrationInPharmacy Create(RegistrationInPharmacyDto dto)
        {
            RegistrationInPharmacy registration = RegistrationInPharmacyAdapter.RegistrationDtoToRegistration(dto);

            if (isApiKeyUnique(registration.ApiKey))
            {
                return(RegistrationInPharmacyRepository.Create(registration));
            }
            return(null);
        }
 public RegistrationInPharmacy createIRegistration(RegistrationInPharmacyDto dto)
 {
     foreach (RegistrationInPharmacy registrationIRepo in IRegistrationRepository.GetAll())
     {
         if (registrationIRepo.ApiKey.Equals(RegistrationInPharmacyAdapter.RegistrationDtoToRegistration(dto).ApiKey))
         {
             return(null);
         }
     }
     return(RegistrationInPharmacyAdapter.RegistrationDtoToRegistration(dto));
 }
Exemple #4
0
 public static RegistrationInPharmacy RegistrationDtoToRegistration(RegistrationInPharmacyDto dto)
 {
     return(new RegistrationInPharmacy(dto.PharmacyId, dto.Town, dto.PharmacyConnectionInfo, dto.PharmacyNameInfo));
 }
Exemple #5
0
 public static RegistrationInPharmacy RegistrationDtoToRegistration(RegistrationInPharmacyDto dto)
 {
     return(new RegistrationInPharmacy(dto.PharmacyId, dto.ApiKey, dto.Name, dto.Town));
 }