From 98ecf61dff379d9f46468820e602c936aaa660f1 Mon Sep 17 00:00:00 2001 From: Janie <109517022+Janie06@users.noreply.github.com> Date: Mon, 6 Feb 2023 18:07:59 +0800 Subject: [PATCH] =?UTF-8?q?[WHAT]=20=E4=BD=BF=E7=94=A8=E8=80=85=E9=A0=AD?= =?UTF-8?q?=E5=83=8F=E5=9B=9E=E5=82=B3=E5=8A=A0=E4=B8=8A=E5=AE=8C=E6=95=B4?= =?UTF-8?q?=E7=B6=B2=E5=9D=80=20[WHY]=20=E9=96=8B=E7=99=BC=20ShowEasy=20?= =?UTF-8?q?=E5=89=8D=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EasyBL.WEBAPP/ShowEasy/MembersService.cs | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/EuroTran/EasyBL.WEBAPP/ShowEasy/MembersService.cs b/EuroTran/EasyBL.WEBAPP/ShowEasy/MembersService.cs index 330407c..9901d25 100644 --- a/EuroTran/EasyBL.WEBAPP/ShowEasy/MembersService.cs +++ b/EuroTran/EasyBL.WEBAPP/ShowEasy/MembersService.cs @@ -7,6 +7,7 @@ using Entity; using Entity.ShowEasyDtos; using Entity.Sugar; using Newtonsoft.Json; +using SqlSugar; using SqlSugar.Base; using System; using System.Net; @@ -151,14 +152,22 @@ namespace EasyBL.WEBAPP.SYS { do { + string requestUrl = Common.ConfigGetValue("", "ida:RedirectUri"); var saCountry = db.Queryable() //搜尋條件 .Where(x => x.OrgID == OrgID && x.Account == Account) + .Single(); + + var sFilePath = db.Queryable() + .Where(x => x.ParentID == saCountry.MemberID) + .Single(); + + saCountry.MemberPicture = requestUrl + "/" + sFilePath.FilePath.Replace("\\", "/"); + var iRel = db.Insertable(saCountry).ExecuteCommand(); - .First(); //返回user信息 srm = new SuccessResponseMessage(null, null); - srm.DATA.Add(BLWording.REL, saCountry); + srm.DATA.Add(BLWording.REL, iRel); } while (false); } @@ -212,23 +221,29 @@ namespace EasyBL.WEBAPP.SYS #region Upload 上傳文件 - public HttpResponseMessage UploadAvatar() + public HttpResponseMessage Upload(string OrgID, string Account) { SuccessResponseMessage srm = null; string sError = null; try { var c = HttpContext.Current; + + //var c = MemberPicture; + var sGUID = Guid.NewGuid().ToString(); + SECommonService commonService = new SECommonService(); // 文件上傳 HttpResponseMessage ret = commonService.Upload(c); if (ret.StatusCode == HttpStatusCode.OK) { - // 根據用戶id修改用戶頭像 + var db = SugarBase.DB; SETB_CMS_Member i_crm = new SETB_CMS_Member(); - // 缺userid 和orgid - var iRel = db.Updateable(i_crm).ExecuteCommand(); + //// 缺userid 和orgid + var iRel = db.Updateable(i_crm) + .Where(i_crm.OrgID == OrgID && i_crm.Accountz) + .ExecuteCommand(); srm = new SuccessResponseMessage(null, null); srm.DATA.Add(BLWording.REL, iRel); } @@ -246,6 +261,7 @@ namespace EasyBL.WEBAPP.SYS return HttpResponseExtension.ToJson(JsonConvert.SerializeObject(srm)); } + #endregion Upload 上傳文件 //註銷帳號