This commit is contained in:
2022-03-11 15:17:01 +00:00
parent e632e763e5
commit d7d8e9340c

View File

@@ -615,7 +615,7 @@ namespace AyaNova.Api.Controllers
using (var cmd = ct.Database.GetDbConnection().CreateCommand())
{
await ct.Database.OpenConnectionAsync();
cmd.CommandText = $@"select afileattachment.id, displayfilename,contenttype,lastmodified, afileattachment.notes, size, auser.name as attachedbyuser from afileattachment
cmd.CommandText = $@"select afileattachment.id, afileattachment.xmin as concurrency, displayfilename,contenttype,lastmodified, afileattachment.notes, size, auser.name as attachedbyuser from afileattachment
left join auser on (afileattachment.attachedByUserId=auser.id)
where attachtoatype={(int)ayaType} and attachtoobjectid={ayaId}
order by displayfilename";
@@ -637,12 +637,13 @@ namespace AyaNova.Api.Controllers
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)
Concurrency=(UInt32)dr.GetValue(1),
DisplayFileName = dr.GetString(2),
ContentType = dr.GetString(3),
LastModified = dr.GetDateTime(4),
Notes = dr.GetString(5),
Size = dr.GetInt64(6),
AttachedByUser = dr.GetString(7)
});
}
}
@@ -654,7 +655,7 @@ namespace AyaNova.Api.Controllers
private class FileAttachmentListItem
{
public long Id { get; set; }
// public uint Concurrency { get; set; }
public uint Concurrency { get; set; }
public string DisplayFileName { get; set; }
public string ContentType { get; set; }//mime type
public DateTime LastModified { get; set; }