コード例 #1
0
        public ActionResult CancelledPatientAppointment(PolyClinicListOfCancelledPatientAppointment viewModel)
        {
            if (ModelState.IsValid)
            {
                if (Request.IsAjaxRequest())
                {
                    var operatorId   = viewModel.EmployeeId.HasValue? viewModel.EmployeeId.Value: 0;
                    var doctorId     = viewModel.DoctorId.HasValue? viewModel.DoctorId.Value: 0;
                    var appointments = _clPolyClinicDB.getCancelledPatientReservation(viewModel.StartDate, viewModel.EndDate.AddDays(1), operatorId, doctorId, (int)viewModel.PatientType, viewModel.DepartmentId);

                    if (appointments.Rows.Count > 0)
                    {
                        ReportViewer   reportViewer = new ReportViewer();
                        ReportViewerVm reportVM     = new ReportViewerVm();
                        reportViewer.ProcessingMode         = ProcessingMode.Local;
                        reportViewer.LocalReport.ReportPath = Request.MapPath(Request.ApplicationPath) + @"\Areas\ManagementReports\Reports\PolyClinic\CancelledPatientAppointmentList.rdlc";
                        reportViewer.LocalReport.DataSources.Add(new ReportDataSource("CancelledPatientAppointments", appointments));
                        reportViewer = this.DynamicReportHeader(reportViewer, "DataSet2");
                        if (viewModel.DoctorId.HasValue)
                        {
                            reportViewer.LocalReport.SetParameters(new ReportParameter("filterDoctor", Boolean.TrueString));
                        }
                        if (viewModel.EmployeeId.HasValue)
                        {
                            reportViewer.LocalReport.SetParameters(new ReportParameter("filterCancelledByEmployee", Boolean.TrueString));
                        }
                        if (viewModel.DepartmentId > 0)
                        {
                            reportViewer.LocalReport.SetParameters(new ReportParameter("filterDepartment", Boolean.TrueString));
                        }
                        if (viewModel.PatientType > 0)
                        {
                            reportViewer.LocalReport.SetParameters(new ReportParameter("filterPatientType", Boolean.TrueString));
                        }


                        reportViewer.LocalReport.SetParameters(new ReportParameter("startDate", viewModel.StartDate.ToString()));
                        reportViewer.LocalReport.SetParameters(new ReportParameter("endDate", viewModel.EndDate.ToString()));
                        reportViewer.SizeToReportContent = true;
                        reportViewer.Width    = Unit.Percentage(100);
                        reportViewer.Height   = Unit.Percentage(100);
                        reportVM.ReportViewer = reportViewer;

                        System.Web.HttpContext.Current.Session[Global.ReportViewerSessionName] = reportViewer;
                        System.Web.HttpContext.Current.Session[Global.PdfUriSessionName]       = Common.Helper.getApplicationUri("Preview", "Print", null);
                        return(PartialView("~/Views/Shared/_reportViewer.cshtml", reportVM));
                    }
                    else
                    {
                        return(Content(Errors.ReportContent("NO RECORDS FOUND")));
                    }
                }
            }

            return(Content(""));
        }
コード例 #2
0
        public ActionResult CancelledPatientAppointment()
        {
            var viewModel = new PolyClinicListOfCancelledPatientAppointment()
            {
                StartDate       = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day),
                EndDate         = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.AddDays(1).Day),
                PatientTypeList = new List <KeyValuePair <DoctorSchedulePatientType, string> >()
                {
                    new KeyValuePair <DoctorSchedulePatientType, string>(DoctorSchedulePatientType.ALL, DoctorSchedulePatientType.ALL.ToString()),
                    new KeyValuePair <DoctorSchedulePatientType, string>(DoctorSchedulePatientType.IP, DoctorSchedulePatientType.IP.ToString()),
                    new KeyValuePair <DoctorSchedulePatientType, string>(DoctorSchedulePatientType.OP, DoctorSchedulePatientType.OP.ToString())
                },
                DoctorId       = 0,
                DepartmentList = departmentDB.getAllDepartment()
            };



            return(View(viewModel));
        }