case 4141

This commit is contained in:
2022-03-11 00:22:02 +00:00
parent 09972da7e4
commit 794991d617

View File

@@ -616,7 +616,7 @@ namespace AyaNova.Api.Controllers
{
await ct.Database.OpenConnectionAsync();
cmd.CommandText = $@"select afileattachment.id, displayfilename,contenttype,lastmodified, afileattachment.notes, size, auser.name as attachedbyuser from afileattachment
left join auser on (afileattachment.attachtoobjectid=auser.id)
left join auser on (afileattachment.attachedByUserId=auser.id)
where attachtoatype={(int)ayaType} and attachtoobjectid={ayaId}
order by displayfilename";
@@ -624,15 +624,26 @@ namespace AyaNova.Api.Controllers
{
while (dr.Read())
{
retList.Add(new FileAttachmentListItem() {
Id = dr.GetInt64(0),
DisplayFileName = dr.GetString(1),
ContentType = dr.GetString(2),
LastModified = dr.GetDateTime(3),
Notes = dr.GetString(4),
AttachedByUser = dr.GetString(5),
Size = dr.GetInt64(6)
});
// var v = new FileAttachmentListItem();
// v.Id = dr.GetInt64(0);
// v.DisplayFileName = dr.GetString(1);
// v.ContentType = dr.GetString(2);
// v.LastModified = dr.GetDateTime(3);
// v.Notes = dr.GetString(4);
// v.AttachedByUser = dr.GetString(5);
// v.Size = dr.GetInt64(6);
// retList.Add(v);
retList.Add(new FileAttachmentListItem()
{
Id = dr.GetInt64(0),
DisplayFileName = dr.GetString(1),
ContentType = dr.GetString(2),
LastModified = dr.GetDateTime(3),
Notes = dr.GetString(4),
Size = dr.GetInt64(5),
AttachedByUser = dr.GetString(6)
});
}
}
}