document.write("
private void RetrieveTodayAppointment() { patients = new List<clsPatientModel>(); appointment = new clsAppointment(); patientDetails = new clsPatientDetails(); var patientsRow = appointment.Retrieve(); if (patientsRow.Count > 0) { foreach (var item in patientsRow) { item.PatientDetails = new clsPatientDetailsModel(); item.PatientDetails = patientDetails.GetByPatientId(item.PatientId); } } foreach (var item in patientsRow) { foreach (var appointment in item.Appointments) { if (appointment.Appointment.Date == DateTime.Today.Date) { clsPatientModel sort = new clsPatientModel { PatientDetails = new clsPatientDetailsModel(), Appointments = new List<clsAppointmentModel>(), PatientId = item.PatientId }; sort.PatientDetails = item.PatientDetails; sort.Appointments.Add(appointment); patients.Add(sort); } } } }