示例#1
0
 public ActionResult GetReportDependantProfileQuit([DataSourceRequest] DataSourceRequest request, Hre_ReportDependantProfileQuitModel Model)
 {
     if (Model != null && Model.IsCreateTemplate)
     {
         var path = Common.GetPath("Templates");
         ExportService exportService = new ExportService();
         ConfigExport cfgExport = new ConfigExport()
         {
             Object = new Hre_ReportDependantProfileQuitModel(),
             FileName = "Hre_ReportDependantProfileQuit",
             OutPutPath = path,
             DownloadPath = Hrm_Main_Web + "Templates",
             IsDataTable = false
         };
         var str = exportService.CreateTemplate(cfgExport);
         return Json(str);
     }
     #region Validate
     string message = string.Empty;
     var checkValidate = ValidatorService.OnValidateData<Hre_ReportDependantProfileQuitModel>(Model, "Hre_ReportPayHDTJob", ref message);
     if (!checkValidate)
     {
         return Json(message, JsonRequestBehavior.AllowGet);
     }
     #endregion
     var ReportServices = new Hre_ReportServices();
     var result = ReportServices.GetReportDependantProfileQuit(Model.DateQuitFrom, Model.DateQuitTo, Model.WorkPlaceID, Model.OrgStructureID, UserLogin).Translate<Hre_ReportDependantProfileQuitModel>();
     if (Model.ExportID != Guid.Empty)
     {
         var fullPath = ExportService.Export(Model.ExportID, result, null, Model.ExportType);
         return Json(fullPath);
     }
     return Json(result.ToDataSourceResult(request));
 }