Contacts
This commit is contained in:
@@ -136,7 +136,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
// Insert ContainerItem.
|
||||
public override bool InsertContainerItem(SbmContainerItem containerItem, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
String fn = GetType().Name + ".InsertContainerItem";
|
||||
ClearErrorState();
|
||||
if (!IsValidContainerItem(containerItem)) return false;
|
||||
if (SysId.IsValid(containerItem.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
||||
@@ -156,7 +155,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
dbContainerItem.ExecuteInsertCommand(dbCommand);
|
||||
containerItem.Id = new SysId(dbContainerItem._ContainerId);
|
||||
containerItem.Changed = false;
|
||||
if (DebugMode) SaLogger.Debug(fn + " Inserted. " + GetLogProperties(containerItem).Concat(": ").Concat("", "\n\t"));
|
||||
if (DebugMode) SaLogger.Debug($"{SysUtil.Fn} Inserted. " + GetLogProperties(containerItem).Concat(": ").Concat("", "\n\t"));
|
||||
}
|
||||
catch (Exception exc) { SetErrorState(exc.Message); }
|
||||
}
|
||||
@@ -167,13 +166,12 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
// Update ContainerItem.
|
||||
public override bool UpdateContainerItem(SbmContainerItem containerItem, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
String fn = GetType().Name + ".UpdateContainerItem";
|
||||
ClearErrorState();
|
||||
if (!IsValidContainerItem(containerItem)) return false;
|
||||
if (!SysId.IsValid(containerItem.Id)) return SetErrorState(ErrorMessage.InvalidItemId);
|
||||
if (!containerItem.Changed)
|
||||
{
|
||||
if (DebugMode) SaLogger.Debug(fn + " Data not changed. " + GetLogProperties(containerItem).Concat(": ").Concat("", "\n\t"));
|
||||
if (DebugMode) SaLogger.Debug($"{SysUtil.Fn} Data not changed. " + GetLogProperties(containerItem).Concat(": ").Concat("", "\n\t"));
|
||||
return true;
|
||||
}
|
||||
using (var dbConnection = db.CreateConnection())
|
||||
@@ -191,7 +189,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
PopulateTo(dbContainerItem, containerItem, dbUpdateInfo);
|
||||
dbContainerItem.ExecuteUpdateCommand(dbCommand);
|
||||
containerItem.Changed = false;
|
||||
if (DebugMode) SaLogger.Debug(fn + " Updated. " + GetLogProperties(containerItem).Concat(": ").Concat("", "\n\t"));
|
||||
if (DebugMode) SaLogger.Debug($"{SysUtil.Fn} Updated. " + GetLogProperties(containerItem).Concat(": ").Concat("", "\n\t"));
|
||||
|
||||
// Record updates.
|
||||
updateLogMonitor.RecordUpdatedValues(containerItem);
|
||||
@@ -212,7 +210,6 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
}
|
||||
public override bool DeleteContainerItem(SbmContainerItem containerItem, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
String fn = GetType().Name + ".DeleteContainerItem";
|
||||
ClearErrorState();
|
||||
if (!ContainerItemCanBeDeleted(containerItem)) return false;
|
||||
using (var dbConnection = db.CreateConnection())
|
||||
@@ -229,7 +226,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Dbas.Mgr
|
||||
dbCommand.CommandText = "DELETE FROM " + SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.ContainerItem) + " WHERE Id=" + SysId.ToString(containerItem.Id) + ";";
|
||||
dbCommand.ExecuteNonQuery();
|
||||
containerItem.Changed = false;
|
||||
if (DebugMode) SaLogger.Debug(fn + " Deleted. " + GetLogProperties(containerItem).Concat(": ").Concat("", "\n\t"));
|
||||
if (DebugMode) SaLogger.Debug($"{SysUtil.Fn} Deleted. " + GetLogProperties(containerItem).Concat(": ").Concat("", "\n\t"));
|
||||
}
|
||||
catch (Exception exc) { SetErrorState(exc.Message); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user