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" } }