Пример #1
0
 public int ValidateOrder(Patient patient, int doctorId, string date, string time)
 {
     var repository = new Repository();
     var result = repository.IsPatientExists(patient);
     if (result == -1)
     {
         return -1;
     }
     if (!repository.SetUsedAvailableTimeByTime(DateTime.Parse(date + " " + time), result))
     {
         return -1;
     }
     var availableTime = repository.GetAvailableTimeByTime(DateTime.Parse(date + " " + time));
     return availableTime != null ? repository.AddOrder(result, doctorId, availableTime.AvailableTimeId) : -1;
 }
Пример #2
0
 public int ValidateHomeOrder(Patient patient, string date, int policlinicId)
 {
     var repository = new Repository();
     var result = repository.IsPatientExists(patient);
     if (result == -1)
     {
         return -1;
     }
     return repository.AddHomeVisitHistory(new HomeVisitHistory()
     {
         Date = DateTime.Parse(date),
         Policlinic = repository.GetPoliclinicById(policlinicId),
         Patient = patient
     });
 }
Пример #3
0
 public int ValidateUser(Patient patient)
 {
     var repository = new Repository();
     return repository.IsPatientExists(patient);
 }