Browse Source

[WHAT] Member Upload Avatar [WHY] 開發 ShowEasy API

Dev
Janie 2 years ago
parent
commit
571acd9345
  1. 3
      EuroTran/EasyBL.WEBAPP/ShowEasy/MembersService.cs
  2. 12
      EuroTran/EasyBL.WEBAPP/ShowEasy/SECommonService.cs

3
EuroTran/EasyBL.WEBAPP/ShowEasy/MembersService.cs

@ -184,7 +184,7 @@ namespace EasyBL.WEBAPP.SYS
if (!string.IsNullOrEmpty(member.MemberPicture)) {
var sFilePath = db.Queryable<OTB_SYS_Files>()
.Where(x => x.ParentID == saUser.MemberPicture)
.Where(x => x.ParentID == member.MemberPicture)
.Single();
member.MemberPicture = requestUrl + "/" + sFilePath.FilePath.Replace("\\", "/");
@ -383,6 +383,7 @@ namespace EasyBL.WEBAPP.SYS
rsMember.BirthDate = Member.BirthDate;
rsMember.Status = Member.Status;
rsMember.OrgID = Member.OrgID;
rsMember.PhoneCode = Member.PhoneCode;
return rsMember;

12
EuroTran/EasyBL.WEBAPP/ShowEasy/SECommonService.cs

@ -212,9 +212,12 @@ namespace EasyBL.WEBAPP.SYS
var sServerPath = c.Server.MapPath("/");
var sRoot = sServerPath + "Document\\EurotranFile";
Common.FnCreateDir(sRoot + "\\" + sSource);//如果沒有該目錄就創建目錄
if (req.Files.Count > 0)
if(req.Files.Count > 0)
{
var saFilesAdd = new List<OTB_SYS_Files>();
for (int index = 0; index < req.Files.Count; index++)
{
var file = req.Files[index];
@ -263,8 +266,8 @@ namespace EasyBL.WEBAPP.SYS
};
saFilesAdd.Add(oFile);
}
var db = SugarBase.DB;
var iRes = db.Insertable(saFilesAdd).ExecuteCommand();
@ -283,6 +286,11 @@ namespace EasyBL.WEBAPP.SYS
srm = new SuccessResponseMessage(null, null);
srm.DATA.Add(BLWording.REL, iRes);
}
}
catch (Exception ex)
{

Loading…
Cancel
Save