public bool RemoveMedicalExam(MedicalExam medicalExam)
 {
     try
     {
         DatabaseConnector.DeleteDBObject(medicalExam);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
예제 #2
0
 public async Task <bool> RemoveMedicalExamAsync(MedicalExam medicalExam)
 {
     try
     {
         _dataContext.Remove(medicalExam);
         _dataContext.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
 public bool AddNewMedicalExam(Driver driver, MedicalExam medicalExam)
 {
     try
     {
         medicalExam.Driver = driver;
         DatabaseConnector.InsertDBObject(medicalExam);
         driver.MedicalExams.Add(medicalExam);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
 public bool ArchiveMedicalExam(Driver driver, MedicalExam medicalExam)
 {
     try
     {
         medicalExam.IsActive = false;
         medicalExam.Archived = DateTime.Now;
         _ = driver.MedicalExams.Remove(medicalExam);
         DatabaseConnector.UpdateDBObject(medicalExam);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
예제 #5
0
        public async Task <bool> AddNewMedicalExamAsync(Driver driver, MedicalExam medicalExam)
        {
            try
            {
                medicalExam.Driver = driver;
                await _dataContext.MedicalExams.AddAsync(medicalExam);

                _dataContext.SaveChanges();
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
예제 #6
0
 public async Task <bool> ArchiveMedicalExamAsync(Driver driver, MedicalExam medicalExam)
 {
     try
     {
         medicalExam.IsActive = false;
         medicalExam.Archived = DateTime.Now;
         _ = driver.ActiveMedicalExams.Remove(medicalExam);
         _dataContext.Update(medicalExam);
         _dataContext.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }