예제 #1
0
        public ActionResult ExportNoHaveSocial([DataSourceRequest] DataSourceRequest request, Ins_ReportNotHaveSocialModel model)
        {
            var services = new Ins_InsuranceRecordServices();
            var result = services.GetReportNotHaveSocial(model.DateFrom, model.DateTo, model.OrgStructureID,UserLogin);
            var lstModel = new List<Ins_ReportNotHaveSocialModel>();
            if (result != null)
            {
                lstModel = result.Translate<Ins_ReportNotHaveSocialModel>();
                //  return Json(lstModel, JsonRequestBehavior.AllowGet);
            }
            var isDataTable = false;
            object obj = new Ins_ReportNotHaveSocialModel();

            if (model.IsCreateTemplateForDynamicGrid)
            {
                obj = result;
                isDataTable = true;
            }
            if (model != null && model.IsCreateTemplate)
            {
                var path = Common.GetPath("Templates");
                ExportService exportService = new ExportService();
                ConfigExport cfgExport = new ConfigExport()
                {
                    Object = obj,
                    FileName = "Ins_ReportNotHaveSocialModel",
                    OutPutPath = path,
                    DownloadPath = "Templates",
                    IsDataTable = isDataTable

                };
                var str = exportService.CreateTemplate(cfgExport);
                return Json(str);
            }
            if (model.ExportId != Guid.Empty)
            {
                var fullPath = ExportService.Export(model.ExportId, lstModel, null, model.ExportType);
                return Json(fullPath);
            }
            return Json(lstModel.ToDataSourceResult(request));
        }
예제 #2
0
 public ActionResult GetReportNotHaveSocial([DataSourceRequest] DataSourceRequest request, Ins_ReportNotHaveSocialModel model)
 {
     var services = new Ins_InsuranceRecordServices();
     var result = services.GetReportNotHaveSocial(model.DateFrom, model.DateTo, model.OrgStructureID,UserLogin);
     var lstModel = new List<Ins_ReportNotHaveSocialModel>();
     if (result != null)
     {
         lstModel = result.Translate<Ins_ReportNotHaveSocialModel>();
         return Json(lstModel.ToDataSourceResult(request));
     }
     return Json(lstModel.ToDataSourceResult(request));
 }