示例#1
0
 public ActionResult GetProfileAllList([DataSourceRequest] DataSourceRequest request, Hre_ProfileAllSearchModel model)
 {
     return GetListDataAndReturn<Hre_ProfileModel, Hre_ProfileEntity, Hre_ProfileAllSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_ProfileAll);
 }
示例#2
0
        public ActionResult ExportProfileAllListByTemplate([DataSourceRequest] DataSourceRequest request, Hre_ProfileAllSearchModel model)
        {
            string status = string.Empty;
            var isDataTable = false;
            var service = new BaseService();
            object obj = new Hre_ProfileModel();
            ListQueryModel lstModel = new ListQueryModel
            {
                PageSize = int.MaxValue - 1,
                PageIndex = 1,
                Filters = ExtractFilterAttributes(request),
                Sorts = ExtractSortAttributes(request),
                AdvanceFilters = ExtractAdvanceFilterAttributes(model)
            };
            var result = GetListData<Hre_ProfileModel, Hre_ProfileEntity, Hre_ProfileAllSearchModel>(request, model, ConstantSql.hrm_hr_sp_get_ProfileAll, 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_ProfileModel",
                    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));
        }