Exemple #1
0
 public ActionResult ExportInterviewList([DataSourceRequest] DataSourceRequest request, Rec_InterviewSearchModel model)
 {
     return ExportAllAndReturn<Rec_InterviewEntity, Rec_InterviewModel, Rec_InterviewSearchModel>(request, model, ConstantSql.hrm_rec_sp_get_Interview);
 }
Exemple #2
0
        public ActionResult ExportInterviewListByTemplate([DataSourceRequest] DataSourceRequest request, Rec_InterviewSearchModel model)
        {
            //return GetListDataAndReturn<Rec_InterviewModel, Rec_InterviewEntity, Rec_InterviewSearchModel>(request, model, ConstantSql.hrm_rec_sp_get_Interview);

            string status = string.Empty;
            var isDataTable = false;
            object obj = new Rec_InterviewModel();
            var services = new BaseService();
            var result = GetListData<Rec_InterviewModel, Rec_InterviewEntity, Rec_InterviewSearchModel>(request, model, ConstantSql.hrm_rec_sp_get_Interview, 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_InterviewModel",
                    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, null, model.ExportType);
                return Json(fullPath);
            }

            return Json(result.ToDataSourceResult(request));

        }