From bd70021a1bcf9d002bbe62da3b4fd98e2b95e5f5 Mon Sep 17 00:00:00 2001 From: Nakorn Rientrakrunchai Date: Sun, 30 Aug 2020 08:16:46 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B9=80=E0=B8=9E=E0=B8=B4=E0=B9=88=E0=B8=A1?= =?UTF-8?q?=E0=B8=95=E0=B8=B1=E0=B8=A7=E0=B9=81=E0=B8=9B=E0=B8=A3=20hr=5Fs?= =?UTF-8?q?vc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ApiControllers/rep_eva_xControllers.cs | 21 +++++++++++++++++---- appsettings.Development.json | 3 ++- appsettings.Production.json | 3 ++- appsettings.Staging.json | 3 ++- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ApiControllers/rep_eva_xControllers.cs b/ApiControllers/rep_eva_xControllers.cs index 8125f31..eb516ce 100644 --- a/ApiControllers/rep_eva_xControllers.cs +++ b/ApiControllers/rep_eva_xControllers.cs @@ -199,10 +199,23 @@ namespace TodoAPI2.Controllers i.employee_position_level = p.employee_position_level; i.employee_org = p.employee_org; i.employee_position = p.employee_position; - //if (!string.IsNullOrEmpty(p.employee_profile_picture)) - //{ - // i.image_url = MyHelper.GetConfig(Configuration, "SiteInformation:mainsite") + "/api/image/" + p.employee_profile_picture; - //} + if (!string.IsNullOrEmpty(p.employee_profile_picture)) + { + i.image_url = MyHelper.GetConfig(Configuration, "SiteInformation:hr_svc") + "/api/image/" + p.employee_profile_picture; + + // Check if i.image_url exist + HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(i.image_url); + request.Method = "HEAD"; + try + { + request.GetResponse(); + } + catch + { + i.image_url = null; + } + } + i.chief_fullname = p.chief_fullname; i.chief_position = p.chief_position; i.supervisor2_fullname = p.supervisor2_fullname; diff --git a/appsettings.Development.json b/appsettings.Development.json index c1956d3..d48224b 100644 --- a/appsettings.Development.json +++ b/appsettings.Development.json @@ -42,7 +42,8 @@ "modulesite": "http://tb320.zd.co.th/menu/evaluation", "sitename": "เนติบัณฑิตยสภา ในพระบรมราชูปถัมภ์", "modulename": "ระบบประวัติเงินเดือนและการเลื่อนเงินเดือน", - "hr_upload_api": "https://hrm.thethaibar.or.th/api/file/upload", + "hr_upload_api": "https://hrm.thethaibar.or.th/api/file/upload", + "hr_scv": "http://tb320.zd.co.th" } } diff --git a/appsettings.Production.json b/appsettings.Production.json index 9157de6..05015b6 100644 --- a/appsettings.Production.json +++ b/appsettings.Production.json @@ -40,7 +40,8 @@ "modulesite": "http://tb320.zd.co.th/menu/evaluation", "sitename": "เนติบัณฑิตยสภา ในพระบรมราชูปถัมภ์", "modulename": "ระบบประวัติเงินเดือนและการเลื่อนเงินเดือน", - "hr_upload_api": "http://tb-320.zd.co.th/api/file/upload" + "hr_upload_api": "http://tb-320.zd.co.th/api/file/upload", + "hr_scv": "http://tb320.zd.co.th" } } diff --git a/appsettings.Staging.json b/appsettings.Staging.json index 1ceb201..5462559 100644 --- a/appsettings.Staging.json +++ b/appsettings.Staging.json @@ -40,7 +40,8 @@ "modulesite": "http://tb320dev.zd.co.th/menu/evaluation", "sitename": "เนติบัณฑิตยสภา ในพระบรมราชูปถัมภ์", "modulename": "ระบบประวัติเงินเดือนและการเลื่อนเงินเดือน", - "hr_upload_api": "http://tb-320.zd.co.th/api/file/upload" + "hr_upload_api": "http://tb-320.zd.co.th/api/file/upload", + "hr_scv": "http://tb320.zd.co.th" } }