Contacts
This commit is contained in:
@@ -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); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user