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)); }
public static RegistrationInPharmacy RegistrationDtoToRegistration(RegistrationInPharmacyDto dto) { return(new RegistrationInPharmacy(dto.PharmacyId, dto.Town, dto.PharmacyConnectionInfo, dto.PharmacyNameInfo)); }
public static RegistrationInPharmacy RegistrationDtoToRegistration(RegistrationInPharmacyDto dto) { return(new RegistrationInPharmacy(dto.PharmacyId, dto.ApiKey, dto.Name, dto.Town)); }