Esempio n. 1
0
        public async Task Should_Create_A_New_Patient()
        {
            var PatientDto = await _PatientAppService.CreateAsync(
                new CreatePatientDto
            {
                Name             = "Edward Bellamy",
                BirthDate        = new DateTime(1850, 05, 22),
                ShortDescription = "Edward Bellamy was an American Patient..."
            }
                );

            PatientDto.Id.ShouldNotBe(0);
            PatientDto.Name.ShouldBe("Edward Bellamy");
        }
Esempio n. 2
0
 public async void Create(ICloseable window)
 {
     try
     {
         if (HasErrors)
         {
             return;
         }
         PatientInput input = new PatientInput()
         {
             FirstName  = FirstName, LastName = LastName,
             MiddleName = MiddleName, BirthDate = BirthDate, PhoneNumber = PhoneNumber, Address = Address
         };
         PatientDto examDto = await(NewPatient ? AppService.CreateAsync(input) : AppService.UpdateAsync(Id, input));
         if (NewPatient)
         {
             EventAggregator.GetEvent <PatientAddedEvent>().Publish(examDto);
         }
         else
         {
             EventAggregator.GetEvent <PatientUpdatedEvent>().Publish(examDto);
         }
         window.Close();
     }
     catch (SqliteException sqlEx)
     {
         ErrorText = sqlEx.Message;
     }
     catch (BusinessException busEx)
     {
         ErrorText = busEx.Message;
     }
 }
Esempio n. 3
0
        public async Task <PatientDto> CreateAsync(PatientCreateDto input)
        {
            int nrMaxFisa = await _patientAppService.MaxNrFisa();

            input.NrFisa = nrMaxFisa + 1;
            return(await _patientAppService.CreateAsync(input));
        }