public ActionResult GetExportReportInterviewListByTemplate([DataSourceRequest] DataSourceRequest request, Rec_ReportInterviewSearchModel model) { HeaderInfo headerInfo1 = new HeaderInfo() { Name = "DateExamFrom", Value = model.DateExamFrom == null ? DateTime.Now : model.DateExamFrom }; HeaderInfo headerInfo2 = new HeaderInfo() { Name = "DateExamTo", Value = model.DateExamTo == null ? DateTime.Now : model.DateExamTo }; List<HeaderInfo> listHeaderInfo = new List<HeaderInfo>() { headerInfo1, headerInfo2 }; string status = string.Empty; var isDataTable = false; object obj = new Rec_ReportInterviewModel(); var services = new BaseService(); var result = GetListData<Rec_ReportInterviewModel, Rec_ReportInterviewEntity, Rec_ReportInterviewSearchModel>(request, model, ConstantSql.hrm_rec_sp_get_ReportInterview, ref status); if (model.IsCreateTemplateForDynamicGrid) { obj = result; isDataTable = false; } if (model != null && model.IsCreateTemplate) { var path = Common.GetPath("Templates"); ExportService exportService = new ExportService(); ConfigExport cfgExport = new ConfigExport() { Object = obj, FileName = "Rec_ReportInterviewModel", OutPutPath = path, HeaderInfo = listHeaderInfo, DownloadPath = Hrm_Main_Web + "Templates", IsDataTable = false }; var str = exportService.CreateTemplate(cfgExport); return Json(str); } if (model.ExportId != Guid.Empty) { var fullPath = ExportService.Export(model.ExportId, result, listHeaderInfo, model.ExportType); return Json(fullPath); } return Json(result.ToDataSourceResult(request)); }
public ActionResult GetReportInterviewList([DataSourceRequest] DataSourceRequest request, Rec_ReportInterviewSearchModel model) { return GetListDataAndReturn<Rec_ReportInterviewModel, Rec_ReportInterviewEntity, Rec_ReportInterviewSearchModel>(request, model, ConstantSql.hrm_rec_sp_get_ReportInterview); }