Ejemplo n.º 1
0
 public IEnumerable <Patient> GetAllPatients()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(PatientMapper.MapPatientPersistenceCollectionToPatientEntityCollection(_context.Patients.ToList()));
     }
 }
Ejemplo n.º 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)));
     }
 }
Ejemplo n.º 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()));
     }
 }
Ejemplo n.º 4
0
 public Report GetReportForAppointment(Guid id)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(ReportMapper.MapReportPersistenceToReportEntity(_context.Reports.SingleOrDefault(c => c.AppointmentPersistanceId.Equals(id))));
     }
 }
Ejemplo n.º 5
0
 public IEnumerable <Allergen> GetAll()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AllergenMapper.MapAllergenPersistenceCollectionToAllergenEntityCollection(_context.Allergens.ToList()));
     }
 }
Ejemplo n.º 6
0
 public Allergen GetById(Guid id)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AllergenMapper.MapAllergenPersistenceToAllergenEntity(_context.Allergens.SingleOrDefault(c => c.Id.Equals(id))));
     }
 }
Ejemplo n.º 7
0
 public IEnumerable <ScheduleEvent> GetAll()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(EventMapper.MapSchedulesPersistenceCollectionTSchedulesEntityCollection(_context.ScheduleEvents.ToList()));
     }
 }
Ejemplo n.º 8
0
 public Appointment GetById(Guid id)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AppointmentMapper.MapAppointmentsPersistenceToAppointmentsEntity(_context.Appointments.SingleOrDefault(c => c.Id.Equals(id))));
     }
 }
Ejemplo n.º 9
0
 public IEnumerable <Specialization> GetAll()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(SpecializationMapper.MapSpecializationPersistenceCollectionToSpecializationEntityCollection(_context.Specializations.ToList()));
     }
 }
Ejemplo n.º 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()));
     }
 }
Ejemplo n.º 11
0
 public Feedback GetById(Guid id)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(FeedbackMapper.MapFeedbackPersistenceToFeedbackEntity(_context.Feedbacks.SingleOrDefault(c => c.Id.Equals(id))));
     }
 }
Ejemplo n.º 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()));
     }
 }
Ejemplo n.º 13
0
 public IEnumerable <Feedback> GetAll()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(FeedbackMapper.MapFeedbackPersistenceCollectionToFeedbackEntityCollection(_context.Feedbacks.ToList()));
     }
 }
Ejemplo n.º 14
0
 public IEnumerable <Doctor> GetAllDoctors()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(DoctorMapper.MapDoctorPersistenceCollectionToDoctorEntityCollection(_context.Doctors.ToList()));
     }
 }
Ejemplo n.º 15
0
 public IEnumerable <Appointment> GetAll()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AppointmentMapper.MapAppointmentsPersistenceCollectionToAppointmentsEntityCollection(_context.Appointments.ToList()));
     }
 }
Ejemplo n.º 16
0
 public IEnumerable <Admin> GetAllAdmins()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AdminMapper.MapAdminPersistenceCollectionToAdminEntityCollection(_context.Admin.ToList()));
     }
 }
Ejemplo n.º 17
0
 public Admin GetAdminById(Guid id)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         return(AdminMapper.MapAdminPersistenceToAdminEntity(_context.Admin.SingleOrDefault(c => c.Id.Equals(id))));
     }
 }
Ejemplo n.º 18
0
 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));
     }
 }
Ejemplo n.º 19
0
 public void Create(User entity)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         // _context.Users.Add(UserMapper.MapUserEntityToUserPersistence(entity));
         _context.SaveChanges();
     }
 }
Ejemplo n.º 20
0
 public void Update(Feedback entity)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         _context.Update(FeedbackMapper.MapFeedbackEntityToFeedbackPersistence(entity));
         _context.SaveChanges();
     }
 }
Ejemplo n.º 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));
     }
 }
Ejemplo n.º 22
0
 public void Create(ScheduleEvent entity)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         _context.ScheduleEvents.Add(EventMapper.MapScheduleEventEntityToScheduleEventPersistence(entity));
         _context.SaveChanges();
     }
 }
Ejemplo n.º 23
0
 public void Create(FeedbackEvent entity)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         _context.FeedbackEvents.Add(EventMapper.MapFeedbackEventEntityToFeedbackEventPersistence(entity));
         _context.SaveChanges();
     }
 }
Ejemplo n.º 24
0
 public void Update(Allergen entity)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         _context.Update(AllergenMapper.MapAllergenEntityToAllergenPersistence(entity));
         _context.SaveChanges();
     }
 }
Ejemplo n.º 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));
     }
 }
Ejemplo n.º 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()));
     }
 }
Ejemplo n.º 27
0
 public IEnumerable <User> GetAll()
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         //return UserMapper.MapUserPersistenceCollectionToUserEntityCollection(_context.Users.ToList());
         return(null);
     }
 }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 29
0
 public void Update(Appointment entity)
 {
     using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext))
     {
         _context.Appointments.Update(AppointmentMapper.MapAppointmentEntityToAppointmentPersistence(entity));
         _context.SaveChanges();
     }
 }
Ejemplo n.º 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));
     }
 }