Modify aygetname postgres function to handle translation of items that do not have a name, also code to back it at server

This commit is contained in:
2021-11-10 01:02:09 +00:00
parent cd6ee9890f
commit 92f06ec12f
23 changed files with 229 additions and 97 deletions

View File

@@ -7,13 +7,13 @@ namespace AyaNova.Biz
//Used by search and eventlog processor
internal static class BizObjectNameFetcherDirect
{
internal static string Name(AyaType ayaType, long id, System.Data.Common.DbCommand cmd)
internal static string Name(AyaType ayaType, long id, long translationid, System.Data.Common.DbCommand cmd)
{
try
{
string ret;
cmd.CommandText = $"select PUBLIC.AYGETNAME({id}, {(int)ayaType}) as m";
cmd.CommandText = $"select PUBLIC.AYGETNAME({id}, {(int)ayaType}, {translationid}) as m";
using (var dr = cmd.ExecuteReader())
{
if (dr.Read())
@@ -40,12 +40,12 @@ namespace AyaNova.Biz
}
//warning: use the above in a loop, not this one
internal static string Name(AyaType ayaType, long id, AyaNova.Models.AyContext ct)
internal static string Name(AyaType ayaType, long id, long translationId, AyaNova.Models.AyContext ct)
{
using (var command = ct.Database.GetDbConnection().CreateCommand())
{
ct.Database.OpenConnection();
return Name(ayaType, id, command);
return Name(ayaType, id,translationId, command);
}
}