put in new ui and backend store image to table

This commit is contained in:
2026-09-20 14:32:59 +10:00
parent 75b49be476
commit 3d83e95613
13 changed files with 194 additions and 55 deletions
@@ -283,7 +283,7 @@ public partial class PersonRepository : IPerson
node.Key = item.Id.ToString();
node.Type = type;
if (item.Image != null)
node.Data.Image = await LoadPersonImage(item.Id,item.Image);
node.Data.Image = await LoadPersonImage(item.Id, (int) enumPhotoType.Profile, item.Image);
node.Icon = "T";
node.StyleClass = getStyleClass(node.Icon);
@@ -392,7 +392,7 @@ public partial class PersonRepository : IPerson
citem.Data = new();
citem.Label = pName;
if (image != null)
citem.Data.Image = await LoadPersonImage(personId,image);
citem.Data.Image = await LoadPersonImage(personId, (int) enumPhotoType.Profile, image);
citem.Icon = "P";
@@ -413,7 +413,7 @@ public partial class PersonRepository : IPerson
child.Type = type;
image = dto.Image;
if (image != null)
child.Data.Image = await LoadPersonImage(dto.Id,image);
child.Data.Image = await LoadPersonImage(dto.Id,(int) enumPhotoType.Profile, image);
child.Icon = "C";
child.StyleClass = getStyleClass(child.Icon);
child.Label = dto.FirstName;
@@ -750,13 +750,13 @@ public partial class PersonRepository : IPerson
return result;
}
private async Task<string> LoadPersonImage(int personId,string filename)
private async Task<string> LoadPersonImage(int personId, int photoType, string filename)
{
string result = "";
// DownloadFileCriteria criteria = new() { FileName = filename };
var resultModel = await _personPhoto.DownloadPersonPhoto(personId, filename);
var resultModel = await _personPhoto.DownloadPersonPhoto(personId, photoType , filename);
//if (resultModel.Data.Content)
string base64String = Convert.ToBase64String(resultModel.Data.Content);