public IEnumerable <Patient> GetAllPatients()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(PatientMapper.MapPatientPersistenceCollectionToPatientEntityCollection(_context.Patients.ToList()));
     }
 }
Beispiel #2
0
 public IEnumerable <Appointment> GetForDoctor(Guid doctorId)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AppointmentMapper.MapAppointmentsPersistenceCollectionToAppointmentsEntityCollection(_context.Appointments.Where(c => c.Id.Equals(doctorId) && c.IsCanceled == false)));
     }
 }
Beispiel #3
0
 public IEnumerable <Appointment> GetForPatient(Guid patientId)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AppointmentMapper.MapAppointmentsPersistenceCollectionToAppointmentsEntityCollection(_context.Appointments.Where(c => c.PatientPersistanceId == patientId && c.IsCanceled == false).ToList()));
     }
 }
 public Report GetReportForAppointment(Guid id)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(ReportMapper.MapReportPersistenceToReportEntity(_context.Reports.SingleOrDefault(c => c.AppointmentPersistanceId.Equals(id))));
     }
 }
Beispiel #5
0
 public IEnumerable <Allergen> GetAll()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AllergenMapper.MapAllergenPersistenceCollectionToAllergenEntityCollection(_context.Allergens.ToList()));
     }
 }
Beispiel #6
0
 public Allergen GetById(Guid id)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AllergenMapper.MapAllergenPersistenceToAllergenEntity(_context.Allergens.SingleOrDefault(c => c.Id.Equals(id))));
     }
 }
 public IEnumerable <ScheduleEvent> GetAll()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(EventMapper.MapSchedulesPersistenceCollectionTSchedulesEntityCollection(_context.ScheduleEvents.ToList()));
     }
 }
Beispiel #8
0
 public Appointment GetById(Guid id)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AppointmentMapper.MapAppointmentsPersistenceToAppointmentsEntity(_context.Appointments.SingleOrDefault(c => c.Id.Equals(id))));
     }
 }
 public IEnumerable <Specialization> GetAll()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(SpecializationMapper.MapSpecializationPersistenceCollectionToSpecializationEntityCollection(_context.Specializations.ToList()));
     }
 }
Beispiel #10
0
 public IEnumerable <Feedback> GetByAllParams(bool publish, bool anonymous, bool approved)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(FeedbackMapper.MapFeedbackPersistenceCollectionToFeedbackEntityCollection(_context.Feedbacks.Where(p => p.Publish == publish && p.Anonymous == anonymous && p.Approved == approved).ToList()));
     }
 }
Beispiel #11
0
 public Feedback GetById(Guid id)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(FeedbackMapper.MapFeedbackPersistenceToFeedbackEntity(_context.Feedbacks.SingleOrDefault(c => c.Id.Equals(id))));
     }
 }
Beispiel #12
0
 public IEnumerable <Doctor> GetDoctorsPerSpecialization(Guid specializationId)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(DoctorMapper.MapDoctorPersistenceCollectionToDoctorEntityCollection(_context.Doctors.Where(c => c.SpecializationId == specializationId).ToList()));
     }
 }
Beispiel #13
0
 public IEnumerable <Feedback> GetAll()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(FeedbackMapper.MapFeedbackPersistenceCollectionToFeedbackEntityCollection(_context.Feedbacks.ToList()));
     }
 }
Beispiel #14
0
 public IEnumerable <Doctor> GetAllDoctors()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(DoctorMapper.MapDoctorPersistenceCollectionToDoctorEntityCollection(_context.Doctors.ToList()));
     }
 }
Beispiel #15
0
 public IEnumerable <Appointment> GetAll()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AppointmentMapper.MapAppointmentsPersistenceCollectionToAppointmentsEntityCollection(_context.Appointments.ToList()));
     }
 }
Beispiel #16
0
 public IEnumerable <Admin> GetAllAdmins()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AdminMapper.MapAdminPersistenceCollectionToAdminEntityCollection(_context.Admin.ToList()));
     }
 }
Beispiel #17
0
 public Admin GetAdminById(Guid id)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AdminMapper.MapAdminPersistenceToAdminEntity(_context.Admin.SingleOrDefault(c => c.Id.Equals(id))));
     }
 }
 public IEnumerable <Appointment> GetAppointmentForDoctorForDate(Guid doctorId, DateTime requestDate)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(this.GetAll().Where(x => x.DoctorId.Equals(doctorId) && x.StartDateTime.Date.Equals(requestDate.Date) && x.IsCanceled == false));
     }
 }
Beispiel #19
0
 public void Create(User entity)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         // _context.Users.Add(UserMapper.MapUserEntityToUserPersistence(entity));
         _context.SaveChanges();
     }
 }
Beispiel #20
0
 public void Update(Feedback entity)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         _context.Update(FeedbackMapper.MapFeedbackEntityToFeedbackPersistence(entity));
         _context.SaveChanges();
     }
 }
Beispiel #21
0
 public Doctor GetDoctorById(Guid id)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         var doctor = _context.Doctors.Include("Specialization").SingleOrDefault(c => c.Id.Equals(id));
         return(DoctorMapper.MapDoctorPersistenceToDoctorEntity(doctor));
     }
 }
 public void Create(ScheduleEvent entity)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         _context.ScheduleEvents.Add(EventMapper.MapScheduleEventEntityToScheduleEventPersistence(entity));
         _context.SaveChanges();
     }
 }
Beispiel #23
0
 public void Create(FeedbackEvent entity)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         _context.FeedbackEvents.Add(EventMapper.MapFeedbackEventEntityToFeedbackEventPersistence(entity));
         _context.SaveChanges();
     }
 }
Beispiel #24
0
 public void Update(Allergen entity)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         _context.Update(AllergenMapper.MapAllergenEntityToAllergenPersistence(entity));
         _context.SaveChanges();
     }
 }
Beispiel #25
0
 public IEnumerable <Appointment> GetAppointmentForDoctorForDate(Guid doctorId, DateTime requestDate)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AppointmentMapper.MapAppointmentsPersistenceCollectionToAppointmentsEntityCollection(_context.Appointments.ToList())
                .Where(x => x.DoctorId.Equals(doctorId) && x.DateRange.StartDateTime.Date.Equals(requestDate.Date) && x.IsCanceled == false));
     }
 }
Beispiel #26
0
 public IEnumerable <WorkTime> GetWorkTimesForDoctor(Guid doctorId)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         var workTimes = _context.WorkTimes.Where(entity => entity.Doctor.Id == doctorId);
         return(WorkTimeMapper.MapWorkTimePersistenceCollectionToWorkTimeEntityCollection(workTimes.ToList()));
     }
 }
Beispiel #27
0
 public IEnumerable <User> GetAll()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         //return UserMapper.MapUserPersistenceCollectionToUserEntityCollection(_context.Users.ToList());
         return(null);
     }
 }
Beispiel #28
0
 public User GetById(Guid id)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         //return UserMapper.MapUserPersistenceToUserEntity(_context.Users.SingleOrDefault(c => c.Id.Equals(id)));
         return(null);
     }
 }
Beispiel #29
0
 public void Update(Appointment entity)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         _context.Appointments.Update(AppointmentMapper.MapAppointmentEntityToAppointmentPersistence(entity));
         _context.SaveChanges();
     }
 }
Beispiel #30
0
 public Patient GetPatientById(Guid id)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         var patient = _context.Patients.Include("DoctorPersistance").SingleOrDefault(c => c.Id.Equals(id));
         return(PatientMapper.MapPatientPersistenceToPatientEntity(patient));
     }
 }