public IEnumerable <Appointment> GetFilteredAppointment(AppointmentFilter appointmentFilter) { ISpecification <Appointment> specification = new AppointmentSpecificationConverter(appointmentFilter).GetSpecification(); var appointments = Find(specification); Bind(appointments); return(appointments); }
public PagedActionResult <Appointment> Search([FromUri] AppointmentFilter filter) { return(SafeGetPagedData <Appointment>((result) => { var totalCount = 0; var data = AppointmentService.Search(filter, ref totalCount); result.Data = data; })); }
private void gridAppointmentList_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { if (e.ColumnIndex == 0 && gridAppointmentList.Rows[e.RowIndex].Cells["STATUS"].Value.ToString() != "เข้าพบแล้ว") { var id = Convert.ToInt32(gridAppointmentList.Rows[e.RowIndex].Cells["AUTO_ID"].Value); ContainerAppointment container = new ContainerAppointment(); var filter = new AppointmentFilter(); TRN_VISITOR visitorObj = new TRN_VISITOR(); filter.AUTO_ID = id; container.Filter = filter; var obj = _service.GetItem(container); visitorObj.CONTACT_EMPLOYEE_ID = obj.TRN_APPOINTMENT.CONTACT_EMPLOYEE_ID; visitorObj.FIRST_NAME = obj.TRN_APPOINTMENT.REQUEST_FIRST_NAME; visitorObj.LAST_NAME = obj.TRN_APPOINTMENT.REQUEST_LAST_NAME; visitorObj.ID_CARD = obj.TRN_APPOINTMENT.REQUEST_ID_CARD; visitorObj.REASON_ID = obj.TRN_APPOINTMENT.REASON_ID; visitorObj.MAS_EMPLOYEE = obj.TRN_APPOINTMENT.MAS_EMPLOYEE; visitorObj.MAS_REASON = obj.TRN_APPOINTMENT.MAS_REASON; frmVisitor frm = new frmVisitor(); frm.visitorObj = visitorObj; frm.formMode = FormMode.Add; frm.visitorMode = VisitorMode.Appointment; if (frm.ShowDialog() == DialogResult.OK) { var res = _service.UpdateStatus(id); if (res.Status) { //MessageBox.Show(Message.MSG_SAVE_COMPLETE, "แจ้งเตือน", MessageBoxButtons.OK, MessageBoxIcon.Information); ResetScreen(); } else { MessageBox.Show(res.ExceptionMessage, "แจ้งเตือน", MessageBoxButtons.OK, MessageBoxIcon.Information); } } //var res = _service.UpdateStatus(id); //if (res.Status) //{ // MessageBox.Show(Message.MSG_SAVE_COMPLETE, "แจ้งเตือน", MessageBoxButtons.OK, MessageBoxIcon.Information); // ResetScreen(); //} //else //{ // MessageBox.Show(res.ExceptionMessage, "แจ้งเตือน", MessageBoxButtons.OK, MessageBoxIcon.Information); //} } } }
public IActionResult AppointmentsFilterListing([FromBody] AppointmentFilter appoinfo) { //List<AppointmentDetailsDTO> response = repository.AppointmentsFilterListing(appoinfo); //if (response != null) //{ // return new ObjectResult(response); //} //else return new NotFoundObjectResult("0 Appointments found."); List <AppointmentDetailsDTO> result = repository.AppointmentsFilterListing(appoinfo); return(new ObjectResult(result)); }
public IEnumerable <Appointment> GetFilteredAppointment(AppointmentFilter appointmentFilter) { ISpecification <Appointment> specification = new AppointmentSpecificationConverter(appointmentFilter).GetSpecification(); var appointments = Find(specification); var eagerApps = GetAllEager(); IEnumerable <Appointment> result = new List <Appointment>(); foreach (var app in appointments) { foreach (var eagerApp in eagerApps) { if (app.Id == eagerApp.Id) { result.Append(eagerApp); } } } return(result); }
private void BindGridData() { var filter = new AppointmentFilter() { ID_CARD = txtIDCard.Text, FIRST_NAME = txtName.Text, LAST_NAME = txtLastName.Text, LICENSE_PLATE = txtLicense.Text, }; if (chkDate.Checked) { filter.CONTACT_DATE = dtContactDate.Value; } _container.Filter = filter; _container = _service.Retrieve(_container); SetDataSourceHeader(gridAppointmentList, ListHeader(), _container.ResultObj); SetPageControl(_container); }
public Task <IEnumerable <Appointment> > GetWithFilter(AppointmentFilter filter) { throw new NotImplementedException(); }
public AppointmentSpecificationConverter(AppointmentFilter filter) { _filter = filter; }
public IEnumerable <Appointment> GetFilteredAppointment(AppointmentFilter appointmentFilter) => _appointmentService.GetFilteredAppointment(appointmentFilter);
public List <AppointmentDetailsDTO> AppointmentsFilterListing(AppointmentFilter filter) { StoreContext db = new StoreContext(); List <AppointmentDetails> list = db.AppointmentDetails.ToList(); #region Sorting if (filter.SortDirection.ToLower() == "asc") { switch (filter.SortColumn.ToLower()) { case "DetailsId": list = list.OrderBy(b => b.DetailsId).ToList(); break; case "Appointmentid": list = list.OrderBy(b => b.AppointmentId).ToList(); break; case "PatientId": list = list.OrderBy(b => b.PatientId).ToList(); break; case "Diagnosis": list = list.OrderBy(b => b.Diagnosis).ToList(); break; case "Treatment": list = list.OrderBy(b => b.Treatment).ToList(); break; case "TotalAmount": list = list.OrderBy(b => b.TotalAmount).ToList(); break; case "Paid": list = list.OrderBy(b => b.Paid).ToList(); break; } } else { switch (filter.SortColumn.ToLower()) { case "DetailsId": list = list.OrderByDescending(b => b.DetailsId).ToList(); break; case "Appointmentid": list = list.OrderByDescending(b => b.AppointmentId).ToList(); break; case "PatientId": list = list.OrderByDescending(b => b.PatientId).ToList(); break; case "Diagnosis": list = list.OrderByDescending(b => b.Diagnosis).ToList(); break; case "Treatment": list = list.OrderByDescending(b => b.Treatment).ToList(); break; case "TotalAmount": list = list.OrderByDescending(b => b.TotalAmount).ToList(); break; case "Paid": list = list.OrderByDescending(b => b.Paid).ToList(); break; } } #endregion List <AppointmentDetailsDTO> appointmentDetails = mapper.Map <List <AppointmentDetailsDTO> >(list); int totalCount = db.AppointmentDetails.Count(); appointmentDetails = appointmentDetails.Skip((filter.PageNumber - 1) * filter.PageSize) .Take(filter.PageSize) .ToList(); List <AppointmentDetailsDTO> response = mapper.Map <List <AppointmentDetailsDTO> >(appointmentDetails); return(response); }