Пример #1
0
 public ActionResult ExportRelativesList([DataSourceRequest] DataSourceRequest request, Hre_RelativesSearchModel model)
 {
     return ExportAllAndReturn<Hre_RelativesEntity, Hre_RelativesModel, Hre_RelativesSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_Relatives);
 }
Пример #2
0
        public ActionResult ExportRelativesListByTemplate([DataSourceRequest] DataSourceRequest request, Hre_RelativesSearchModel model)
        {

            string status = string.Empty;
            var isDataTable = false;
            object obj = new Hre_RelativesModel();
            var actionServices = new ActionService(UserLogin);
            var result = GetListData<Hre_RelativesModel, Hre_RelativesEntity, Hre_RelativesSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_Relatives, 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 = "Hre_RelativesModel",
                    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));


            //return GetListDataAndReturn<Hre_RelativesModel, Hre_RelativesEntity, Hre_RelativesSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_Relatives);
        }