public IEnumerable <Patient> GetAllPatients() { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { return(PatientMapper.MapPatientPersistenceCollectionToPatientEntityCollection(_context.Patients.ToList())); } }
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))); } }
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)))); } }
public IEnumerable <Allergen> GetAll() { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { return(AllergenMapper.MapAllergenPersistenceCollectionToAllergenEntityCollection(_context.Allergens.ToList())); } }
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())); } }
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())); } }
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())); } }
public Feedback GetById(Guid id) { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { return(FeedbackMapper.MapFeedbackPersistenceToFeedbackEntity(_context.Feedbacks.SingleOrDefault(c => c.Id.Equals(id)))); } }
public IEnumerable <Doctor> GetDoctorsPerSpecialization(Guid specializationId) { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { return(DoctorMapper.MapDoctorPersistenceCollectionToDoctorEntityCollection(_context.Doctors.Where(c => c.SpecializationId == specializationId).ToList())); } }
public IEnumerable <Feedback> GetAll() { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { return(FeedbackMapper.MapFeedbackPersistenceCollectionToFeedbackEntityCollection(_context.Feedbacks.ToList())); } }
public IEnumerable <Doctor> GetAllDoctors() { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { return(DoctorMapper.MapDoctorPersistenceCollectionToDoctorEntityCollection(_context.Doctors.ToList())); } }
public IEnumerable <Appointment> GetAll() { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { return(AppointmentMapper.MapAppointmentsPersistenceCollectionToAppointmentsEntityCollection(_context.Appointments.ToList())); } }
public IEnumerable <Admin> GetAllAdmins() { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { return(AdminMapper.MapAdminPersistenceCollectionToAdminEntityCollection(_context.Admin.ToList())); } }
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)); } }
public void Create(User entity) { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { // _context.Users.Add(UserMapper.MapUserEntityToUserPersistence(entity)); _context.SaveChanges(); } }
public void Update(Feedback entity) { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { _context.Update(FeedbackMapper.MapFeedbackEntityToFeedbackPersistence(entity)); _context.SaveChanges(); } }
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(); } }
public void Create(FeedbackEvent entity) { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { _context.FeedbackEvents.Add(EventMapper.MapFeedbackEventEntityToFeedbackEventPersistence(entity)); _context.SaveChanges(); } }
public void Update(Allergen entity) { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { _context.Update(AllergenMapper.MapAllergenEntityToAllergenPersistence(entity)); _context.SaveChanges(); } }
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)); } }
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())); } }
public IEnumerable <User> GetAll() { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { //return UserMapper.MapUserPersistenceCollectionToUserEntityCollection(_context.Users.ToList()); return(null); } }
public User GetById(Guid id) { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { //return UserMapper.MapUserPersistenceToUserEntity(_context.Users.SingleOrDefault(c => c.Id.Equals(id))); return(null); } }
public void Update(Appointment entity) { using (MQuinceDbContext _context = new MQuinceDbContext(_dbContext)) { _context.Appointments.Update(AppointmentMapper.MapAppointmentEntityToAppointmentPersistence(entity)); _context.SaveChanges(); } }
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)); } }