Beispiel #1
0
 public void ChangeDiagnosis(Diagnosis diagnosis)
 {
     try
     {
         _context.Entry(diagnosis).State = EntityState.Modified;
         _context.SaveChanges();
     }
     catch (Exception e)
     {
         _loggerService.Error($"{e}");
         throw;
     }
 }
Beispiel #2
0
 public void Update(Patient patient)
 {
     try
     {
         _context.Entry(patient).State = EntityState.Modified;
         _context.SaveChanges();
     }
     catch (Exception e)
     {
         _loggerService.Error($"{e}");
         throw;
     }
 }
Beispiel #3
0
 public void Create(Speciality speciality)
 {
     try
     {
         _context.Specialties.Add(speciality);
         _context.SaveChanges();
     }
     catch (Exception e)
     {
         _loggerService.Error($"{e}");
         throw;
     }
 }
Beispiel #4
0
        public void ChangePrescriptionStatus(int?id)
        {
            var prescription = _context.Prescriptions.SingleOrDefault(p => p.PrescriptionType.Id == id);

            try
            {
                if (prescription == null)
                {
                    return;
                }
                prescription.IsDone = !prescription.IsDone;
                _context.Entry(prescription).State = EntityState.Modified;
                _context.SaveChanges();
            }
            catch (Exception e)
            {
                _loggerService.Error($"{e}");
                throw;
            }
        }
Beispiel #5
0
 public void Update(Doctor doctor)
 {
     _context.Entry(doctor).State = EntityState.Modified;
     _context.SaveChanges();
 }