public IActionResult List(DataSourceRequest command) { ViewBag.FormName = "TreatmentRecord"; var model = new TreatmentRecordListModel(); ViewBag.PageSizeDropdown = SelectListHelper.GetPageSizeDropdown(command.PageSize.ToString()); var PagedList = _reportService.GetAllTreatmentRecords( page_num: command.Page, page_size: command.PageSize == 0 ? 10 : command.PageSize, GetAll: command.PageSize == 0 ? true : false); PagedList.List = PagedList.List.Select(a => { a.HospitalName = (a.HospitalName != null) ? _encryptionService.DecryptText(a.HospitalName) : null; a.ContactPerson = (a.ContactPerson != null) ? _encryptionService.DecryptText(a.ContactPerson) : null; a.NurseFirstName = (a.NurseFirstName != null) ? _encryptionService.DecryptText(a.NurseFirstName) : null; a.NurseLastName = (a.NurseLastName != null) ? _encryptionService.DecryptText(a.NurseLastName) : null; a.PateintName = (a.PateintName != null) ? _encryptionService.DecryptText(a.PateintName) : null; a.MR = (a.MR != null) ? _encryptionService.DecryptText(a.MR) : null; return(a); }).ToList(); model.List = PagedList.List.GetPaged(command.Page, command.PageSize, PagedList.TotalRecords); PrepareTreatmentRecordModel(model); return(View(model)); }
//Get List Of Appointment Using Pagination in Stored Procedure public IActionResult Index(DataSourceRequest command) { ViewBag.FormName = "Appointments"; var model = new AppointmentListModel(); try { ViewBag.PageSizeDropdown = SelectListHelper.GetPageSizeDropdown(command.PageSize.ToString()); var PagedList = _reportService.GetAllAppointment( keywords: "", page_num: command.Page, page_size: command.PageSize == 0 ? 10 : command.PageSize, GetAll: command.PageSize == 0 ? true : false); //pratiksha get hospital name in Decrypt format 28/nov/2019 PagedList = PagedList.Select(a => { a.HospitalName = _encryptionService.DecryptText(a.HospitalName); return(a); }).ToList(); model.List = PagedList.GetPaged(command.Page, command.PageSize, ((PagedList.Count() != 0)?PagedList[0].TotalRecords:0)); return(View(model)); } catch (Exception ex) { Console.WriteLine(ex.Message); return(View(model)); } }
public IActionResult Report(DataSourceRequest command) { ViewBag.FormName = "Treatment Report"; ViewBag.SortByReportDropdown = PrepareSortByDropdown(); var model = new TreatmentsReportListModel(); ViewBag.PageSizeDropdown = SelectListHelper.GetPageSizeDropdown(command.PageSize.ToString()); var PagedList = _reportService.GetTreatmentRecordReport( page_num: command.Page, page_size: command.PageSize == 0 ? 10 : command.PageSize, GetAll: command.PageSize == 0 ? true : false, HospitalId: model.HospitalId, NurseId: model.NurseId, PatientId: model.PatientId, ProcedureId: model.ProcedureId, ReportType: model.ReportType, DiagnosisId: model.DiagnosisId, StartDate: model.StartDate.ToString(), EndDate: model.EndDate.ToString()); var report = PagedList.List.GetPaged(command.Page, command.PageSize, PagedList.TotalRecords); model.List = report.Results.Select(a => { var data = new TreatmentReportModel(); data.Date = a.Date; data.PatientName = (a.PatientName != null)?_encryptionService.DecryptText(a.PatientName):null; data.Diagnosis = a.Diagnosis; data.Hospital = (a.Hospital != null) ? _encryptionService.DecryptText(a.Hospital) : null; data.MR = (a.MR != null) ? _encryptionService.DecryptText(a.MR) : null; data.NurseFirstName = (a.NurseFirstName != null) ? _encryptionService.DecryptText(a.NurseFirstName) : null; data.NurseLastName = (a.NurseLastName != null) ? _encryptionService.DecryptText(a.NurseLastName) : null; data.procedure = a.procedure; return(data); }).ToList(); //model.List = report.List.GetPaged(command.Page, command.PageSize, PagedList.TotalRecords); PrepareTreatmentReportModel(model); return(View(model)); }
public IActionResult Index(DataSourceRequest command) { if (!(bool)SharedData.isCompanyProfileMenuAccessible) { return(AccessDeniedView()); } ViewBag.FormName = "CompanyProfile"; var model = new CompanyProfileListModel(); ViewBag.PageSizeDropdown = SelectListHelper.GetPageSizeDropdown(command.PageSize.ToString()); var PagedList = _reportService.GetAllCompanyProfiles( keywords: "", page_num: command.Page, page_size: command.PageSize, GetAll: command.PageSize == 0 ? true : false ); model.List = PagedList.List.GetPaged(command.Page, command.PageSize, PagedList.TotalRecords); return(View(model)); }
public IActionResult List(DataSourceRequest command, TreatmentRecordListModel model, string submittbutton) { ViewBag.FormName = "TreatmentRecord"; switch (submittbutton) { //25/10/19 aakansha pdf case "ExportPDF": var treatmentRecords = _reportService.GetAllTreatmentRecords( page_num: command.Page, page_size: command.PageSize == 0 ? 10 : command.PageSize, GetAll: command.PageSize == 0 ? true : false, HospitalId: model.HospitalId, NurseId: model.NurseId, PatientId: model.PatientId, DaignosisId: model.DaignosisId, StartDate: model.StartDate.ToString(), EndDate: model.EndDate.ToString() ); return(ExportTreatmentRecordList(treatmentRecords.List)); //31/10/19 aakansha excel case "ExportExcel": var treatmentRecordsExcel = _reportService.GetAllTreatmentRecords( page_num: command.Page, page_size: command.PageSize == 0 ? 10 : command.PageSize, GetAll: command.PageSize == 0 ? true : false, HospitalId: model.HospitalId, NurseId: model.NurseId, PatientId: model.PatientId, DaignosisId: model.DaignosisId, StartDate: model.StartDate.ToString(), EndDate: model.EndDate.ToString() ); treatmentRecordsExcel.List = treatmentRecordsExcel.List.Select(a => { a.HospitalName = (a.HospitalName != null) ? _encryptionService.DecryptText(a.HospitalName) : null; a.ContactPerson = (a.ContactPerson != null) ? _encryptionService.DecryptText(a.ContactPerson) : null; a.NurseFirstName = (a.NurseFirstName != null) ? _encryptionService.DecryptText(a.NurseFirstName) : null; a.NurseLastName = (a.NurseLastName != null) ? _encryptionService.DecryptText(a.NurseLastName) : null; a.PateintName = (a.PateintName != null) ? _encryptionService.DecryptText(a.PateintName) : null; a.MR = (a.MR != null) ? _encryptionService.DecryptText(a.MR) : null; return(a); }).ToList(); return(ExportReport(treatmentRecordsExcel, "Treatment Record")); case "ExprtWord": var treatmentRecordsWord = _reportService.GetAllTreatmentRecords( page_num: command.Page, page_size: command.PageSize == 0 ? 10 : command.PageSize, GetAll: command.PageSize == 0 ? true : false, HospitalId: model.HospitalId, NurseId: model.NurseId, PatientId: model.PatientId, DaignosisId: model.DaignosisId, StartDate: model.StartDate.ToString(), EndDate: model.EndDate.ToString() ); return(CreateTreatmentRecordDoc(treatmentRecordsWord)); } ViewBag.PageSizeDropdown = SelectListHelper.GetPageSizeDropdown(command.PageSize.ToString()); var PagedList = _reportService.GetAllTreatmentRecords( page_num: command.Page, page_size: command.PageSize == 0 ? 10 : command.PageSize, GetAll: command.PageSize == 0 ? true : false, HospitalId: model.HospitalId, NurseId: model.NurseId, PatientId: model.PatientId, DaignosisId: model.DaignosisId, StartDate: model.StartDate.ToString(), EndDate: model.EndDate.ToString()); PagedList.List = PagedList.List.Select(a => { a.HospitalName = _encryptionService.DecryptText(a.HospitalName); a.ContactPerson = _encryptionService.DecryptText(a.ContactPerson); a.NurseFirstName = _encryptionService.DecryptText(a.NurseFirstName); a.NurseLastName = _encryptionService.DecryptText(a.NurseLastName); a.PateintName = _encryptionService.DecryptText(a.PateintName); a.MR = _encryptionService.DecryptText(a.MR); return(a); }).ToList(); model.List = PagedList.List.GetPaged(command.Page, command.PageSize, PagedList.TotalRecords); PrepareTreatmentRecordModel(model); return(View(model)); }