예제 #1
0
        public ActionResult ExportAllContractExtendList([DataSourceRequest] DataSourceRequest request, Hre_ContractExtendSearchModel model)
        {
            string status = string.Empty;
            Hre_ContractServices ActionServices = new Hre_ContractServices();
            var result = GetListData<Hre_ContractExtendModel, Hre_ContractExtendEntity, Hre_ContractExtendSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_ContractExtendList, ref status);
            var lstEntity = result.Translate<Hre_ContractEntity>();
            DataTable tb = ActionServices.GetDataContract(lstEntity, UserLogin);
            if (model != null && model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();

                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = tb,
                    FileName = "Hre_ContractEntity",
                    OutPutPath = path,
                    DownloadPath = Hrm_Main_Web + "Templates",
                    IsDataTable = true
                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }
            if (model.ExportId != Guid.Empty)
            {
                var fullPath = ExportService.Export(model.ExportId, tb, null, model.ExportType);
                return Json(fullPath);
            }
            return Json(result.ToDataSourceResult(request));

        }
예제 #2
0
 public ActionResult GetContractExtendList([DataSourceRequest] DataSourceRequest request, Hre_ContractExtendSearchModel model)
 {
     return GetListDataAndReturn<Hre_ContractExtendModel, Hre_ContractExtendEntity, Hre_ContractExtendSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_ContractExtendList);
 }