public void Updade(int BloodCenterId, UpdateBloodCenterDTO updateBloodCenter) { var BloodCenter = _bloodCenterRepository.GetById(BloodCenterId); BloodCenter.Update(updateBloodCenter.Name, updateBloodCenter.Responsible, updateBloodCenter.Address, updateBloodCenter.PhoneNumber); _bloodCenterRepository.Update(BloodCenter); }
public int Create(CreateDonationDTO createDonationDTO) { DateTime createdAt = DateTime.UtcNow; var donor = _donorRepository.GetById(int.Parse(createDonationDTO.DonorId)); var bloodcenter = _bloodcenterRepository.GetById(int.Parse(createDonationDTO.BloodCenterId)); var parsedSchedule = DateTime.Parse(createDonationDTO.Schedule); Donation donation = new Donation(int.Parse(createDonationDTO.DonorId), int.Parse(createDonationDTO.BloodCenterId), createDonationDTO.Status, parsedSchedule, createdAt ); return(_donationRepository.Create(donation)); }