예제 #1
0
        public ActionResult GetReportEmpHardJobList([DataSourceRequest] DataSourceRequest request, Ins_ReportEmpHardJobSearchModel model)
        {
            string status = string.Empty;
            var ReportServices = new Ins_InsuranceReportServices();
            DateTime _DateFrom = DateTime.MinValue;
            DateTime _DateTo = DateTime.MaxValue;
            if (model != null && model.DateFrom != null)
            {
                _DateFrom = model.DateFrom.Value;
            }
            if (model != null && model.DateTo != null)
            {
                _DateTo = model.DateTo.Value;
            }
            var result = ReportServices.BC_EmpHardJob(_DateFrom, _DateTo, model.OrgStructureID);
            var isDataTable = false;
            object obj = new DataTable();
            if (model.IsCreateTemplateForDynamicGrid)
            {
                var col = result.Columns.Count;
                result.Columns.RemoveAt(col - 1);
                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_ReportEmpHardJoblEntity",
                    OutPutPath = path,
                    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 new JsonResult() { Data = result.ToDataSourceResult(request), MaxJsonLength = int.MaxValue };
        }
예제 #2
0
 public ActionResult ReportEmpHardJobListValidate([DataSourceRequest] DataSourceRequest request, Ins_ReportEmpHardJobSearchModel model)
 {
     #region Validate
     string message = string.Empty;
     var checkValidate = ValidatorService.OnValidateData<Ins_ReportEmpHardJobSearchModel>(model, "Ins_ReportEmpHardJob", ref message);
     if (!checkValidate)
     {
         var ls = new object[] { "error", message };
         return Json(ls);
     }
     #endregion
     return Json(message);
 }