From 6f06b1e544df996f331bfaedbe6e9f3340b354d2 Mon Sep 17 00:00:00 2001 From: "LAPTOP-KB8JC2K2\\acer" Date: Thu, 15 Jul 2021 14:31:49 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=95=E0=B8=A3=E0=B8=B5=E0=B8=A2?= =?UTF-8?q?=E0=B8=A1=20code=20=E0=B9=80=E0=B8=9E=E0=B8=B7=E0=B9=88?= =?UTF-8?q?=E0=B8=AD=E0=B8=AA=E0=B8=AD=E0=B8=99=20=E0=B8=81=E0=B8=B2?= =?UTF-8?q?=E0=B8=A3=E0=B8=94=E0=B8=B6=E0=B8=87=E0=B8=82=E0=B9=89=E0=B8=AD?= =?UTF-8?q?=E0=B8=A1=E0=B8=B9=E0=B8=A5=E0=B8=9C=E0=B9=88=E0=B8=B2=E0=B8=99?= =?UTF-8?q?=20C#=20=E0=B9=81=E0=B8=A5=E0=B8=B0=E0=B8=AA=E0=B9=88=E0=B8=87?= =?UTF-8?q?=E0=B9=84=E0=B8=9B=E0=B9=83=E0=B8=AB=E0=B9=89=20report?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...va_adjust_postponement_quotaControllers.cs | 25 +++++++++++++++++++ .../Ieva_adjust_postponement_quotaService.cs | 2 +- .../eva_adjust_postponement_quotaService.cs | 5 ++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/ApiControllers/eva_adjust_postponement_quotaControllers.cs b/ApiControllers/eva_adjust_postponement_quotaControllers.cs index f9c0ca6..f127e46 100644 --- a/ApiControllers/eva_adjust_postponement_quotaControllers.cs +++ b/ApiControllers/eva_adjust_postponement_quotaControllers.cs @@ -340,6 +340,31 @@ namespace TodoAPI2.Controllers string reportsite = MyHelper.GetConfig(Configuration, "JasperReportServer:reportsite"); string username = MyHelper.GetConfig(Configuration, "JasperReportServer:username"); string password = MyHelper.GetConfig(Configuration, "JasperReportServer:password"); + + var postponement_data = (from postponement in _repository.GetContext().eva_adjust_postponement + join create_evaluation in _repository.GetContext().eva_create_evaluation on postponement.create_evaluation_id equals create_evaluation.id + select new + { + create_evaluation.performance_plan_id, + postponement.fiscal_year, + postponement.theDate, + postponement.limit_frame, + postponement.limit_frame_quota + }).FirstOrDefault(); + + var plan = (from q in _repository.GetContext().eva_limit_frame_plan + where q.id == postponement_data.performance_plan_id + select q).FirstOrDefault(); + var start_plan = (from s in _repository.GetContext().eva_performance_plan_detail + where s.performance_plan_id == postponement_data.performance_plan_id + select s.start_date).Min(); + var end_plan = (from s in _repository.GetContext().eva_performance_plan_detail + where s.performance_plan_id == postponement_data.performance_plan_id + select s.end_date).Max(); + + var start_plan_date = MyHelper.GetDateStringForReport(start_plan); + var end_plan_date = MyHelper.GetDateStringForReport(end_plan); + string url = $"{mainurl}{reportsite}/rep_eva_savemessage.{model.filetype}?{MyHelper.GetParameterForJasperReport(model)}&j_username={username}&j_password={password}"; var data = httpclient.DownloadData(url); diff --git a/Models/eva_adjust_postponement_quota/Ieva_adjust_postponement_quotaService.cs b/Models/eva_adjust_postponement_quota/Ieva_adjust_postponement_quotaService.cs index f6738e1..475c059 100644 --- a/Models/eva_adjust_postponement_quota/Ieva_adjust_postponement_quotaService.cs +++ b/Models/eva_adjust_postponement_quota/Ieva_adjust_postponement_quotaService.cs @@ -21,7 +21,7 @@ namespace TodoAPI2.Models eva_adjust_postponement_quotaWithSelectionViewModel GetWithSelection(int id); eva_adjust_postponement_quotaWithSelectionViewModel GetBlankItem(); - + DataContext GetContext(); } } diff --git a/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaService.cs b/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaService.cs index 2486f10..26ac85e 100644 --- a/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaService.cs +++ b/Models/eva_adjust_postponement_quota/eva_adjust_postponement_quotaService.cs @@ -59,6 +59,11 @@ namespace TodoAPI2.Models #region Public Functions #region Query Functions + public DataContext GetContext() + { + return _repository.Context; + } + public eva_adjust_postponement_quotaViewModel Get(int id) { var entity = _repository.Get(id);