Ejemplo n.º 1
0
        public ActionResult ExportCandidateGeneralListByTemplate([DataSourceRequest] DataSourceRequest request, Hre_CandidateGeneralSearchModel model)
        {
            string status = string.Empty;
            var isDataTable = false;
            object obj = new Hre_ProfileModel();
            var result = GetListData<Hre_CandidateGeneralModel, Hre_CandidateGeneralEntity, Hre_CandidateGeneralSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_CandidateGeneral, 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 = new Hre_CandidateGeneralModel(),
                    FileName = "Hre_CandidateGeneral",
                    OutPutPath = path,
                    // HeaderInfo = listHeaderInfo,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = isDataTable
                };
                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));
        }
Ejemplo n.º 2
0
 public ActionResult GetCandidateGeneralList([DataSourceRequest] DataSourceRequest request, Hre_CandidateGeneralSearchModel model)
 {
     return GetListDataAndReturn<Hre_CandidateGeneralModel, Hre_CandidateGeneralEntity, Hre_CandidateGeneralSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_CandidateGeneral);
 }