This commit is contained in:
Andy Howard
2024-11-26 11:33:22 +00:00
parent 8b872cc8f3
commit c8b5df5909
56 changed files with 1122 additions and 860 deletions
@@ -151,7 +151,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
// Insert Process.
public override bool InsertProcess(SbmProcess process, DbUpdateInfo dbUpdateInfo)
{
String fn = GetType().Name + ".InsertProcess";
ClearErrorState();
if (!IsValidProcess(process)) return false;
if (SysId.IsValid(process.Id)) return SetErrorState(ErrorMessage.ValiditemId);
@@ -171,7 +170,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
dbProcess.ExecuteInsertCommand(dbCommand);
process.Id = new SysId(dbProcess._Id);
process.Changed = false;
if (DebugMode) SaLogger.Debug(fn + " Inserted. " + GetLogProperties(process).Concat(": ").Concat("", "\n\t"));
if (DebugMode) SaLogger.Debug($"{SysUtil.Fn} Inserted. " + GetLogProperties(process).Concat(": ").Concat("", "\n\t"));
}
catch (Exception exc) { SetErrorState(exc.Message); }
}
@@ -182,13 +181,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
// Update Process.
public override bool UpdateProcess(SbmProcess process, DbUpdateInfo dbUpdateInfo)
{
String fn = GetType().Name + ".UpdateProcess";
ClearErrorState();
if (!IsValidProcess(process)) return false;
if (!SysId.IsValid(process.Id)) return SetErrorState(ErrorMessage.InvalidItemId);
if (!process.Changed)
{
if (DebugMode) SaLogger.Debug(fn + " Data not changed. " + GetLogProperties(process).Concat(": ").Concat("", "\n\t"));
if (DebugMode) SaLogger.Debug($"{SysUtil.Fn} Data not changed. " + GetLogProperties(process).Concat(": ").Concat("", "\n\t"));
return true;
}
using (var dbConnection = db.CreateConnection())
@@ -206,7 +204,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
PopulateTo(dbProcess, process, dbUpdateInfo);
dbProcess.ExecuteUpdateCommand(dbCommand);
process.Changed = false;
if (DebugMode) SaLogger.Debug(fn + " Updated. " + GetLogProperties(process).Concat(": ").Concat("", "\n\t"));
if (DebugMode) SaLogger.Debug($"{SysUtil.Fn} Updated. " + GetLogProperties(process).Concat(": ").Concat("", "\n\t"));
// Record updates.
updateLogMonitor.RecordUpdatedValues(process);
@@ -227,7 +225,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
}
public override bool DeleteProcess(SbmProcess process, DbUpdateInfo dbUpdateInfo)
{
String fn = GetType().Name + ".DeleteProcess";
ClearErrorState();
if (!ProcessCanBeDeleted(process)) return false;
using (var dbConnection = db.CreateConnection())
@@ -244,7 +241,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
dbCommand.CommandText = "DELETE FROM " + SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.Process) + " WHERE Id=" + SysId.ToString(process.Id) + ";";
dbCommand.ExecuteNonQuery();
process.Changed = false;
if (DebugMode) SaLogger.Debug(fn + " Deleted. " + GetLogProperties(process).Concat(": ").Concat("", "\n\t"));
if (DebugMode) SaLogger.Debug($"{SysUtil.Fn} Deleted. " + GetLogProperties(process).Concat(": ").Concat("", "\n\t"));
}
catch (Exception exc) { SetErrorState(exc.Message); }
}