public void Insert(WorkingHour workingHour)
 {
     using (var dbContext = new SoftTehnicaDbContext())
     {
         dbContext.WorkingHours.Add(workingHour);
         dbContext.SaveChanges();
     }
 }
 public void Insert(Doctor doctor)
 {
     using (var dbContext = new SoftTehnicaDbContext())
     {
         dbContext.Doctors.Add(doctor);
         dbContext.SaveChanges();
     }
 }
Exemple #3
0
 public void Insert(Procedure procedure)
 {
     using (var dbContext = new SoftTehnicaDbContext())
     {
         dbContext.Procedures.Add(procedure);
         dbContext.SaveChanges();
     }
 }
Exemple #4
0
 public void Insert(Appointment appointment)
 {
     using (var dbContext = new SoftTehnicaDbContext())
     {
         dbContext.Entry(appointment.Doctor).State    = EntityState.Unchanged;
         dbContext.Entry(appointment.Procedure).State = EntityState.Unchanged;
         dbContext.Entry(appointment.Time).State      = EntityState.Unchanged;
         dbContext.Appointments.Add(appointment);
         dbContext.SaveChanges();
     }
 }