public void AppointmentSaveTest() { string description = GenString(_r.Next(15, 20)); OpenConnection(); Appointment a = new Appointment(patientService.FindAll()[0].Id, doctorService.FindAll()[0].Id, _r.Next(8, 18), DateTime.Now, description); Assert.IsInstanceOfType(appointmentService.Save(a), typeof(int)); CloseConnection(); }
public DoctorAppointmentsPage() { InitializeComponent(); _patientService = new PatientService(); _appoitmentService = new AppointmentService(); List<Appointment> list = _appoitmentService.FindAll();//GetNextAppointmentsByDoctorId(SessionData.UserSessionData.CurrentUserId); Dictionary<int, Patient> patientList = GetDictionary(_patientService.FindAll()); List<object> dataSet = null; if (list != null) { dataSet = new List<object>(); foreach (Appointment app in list) { Patient p = patientList[app.IdPacient]; dataSet.Add(new { AppointmentId = app.Id, Patient = p.FirstName + " " + p.LastName, Date = app.ScheduledDate.ToString(), Time = app.Time.ToString(), Symtoms = app.Symptoms.ToString() }); } this._cview = new PagingCollectionView(dataSet, 20); this.DataContext = this._cview; } else { buttonPrevious.IsEnabled = false; buttonNext.IsEnabled = false; } }
public DoctorAppointmentsPage() { InitializeComponent(); _patientService = new PatientService(); _appoitmentService = new AppointmentService(); List <Appointment> list = _appoitmentService.FindAll();//GetNextAppointmentsByDoctorId(SessionData.UserSessionData.CurrentUserId); Dictionary <int, Patient> patientList = GetDictionary(_patientService.FindAll()); List <object> dataSet = null; if (list != null) { dataSet = new List <object>(); foreach (Appointment app in list) { Patient p = patientList[app.IdPacient]; dataSet.Add(new { AppointmentId = app.Id, Patient = p.FirstName + " " + p.LastName, Date = app.ScheduledDate.ToString(), Time = app.Time.ToString(), Symtoms = app.Symptoms.ToString() }); } this._cview = new PagingCollectionView(dataSet, 20); this.DataContext = this._cview; } else { buttonPrevious.IsEnabled = false; buttonNext.IsEnabled = false; } }
public List <PatientModel> GetAllPatients() { return(patientService.FindAll()); }