Saxonite 1.2.11.5, BusinessMgr.
This commit is contained in:
@@ -20,18 +20,18 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
// I n t e r f a c e D a t a I t e m s
|
||||
//*******************************************************************
|
||||
// Create Item.
|
||||
public override SaInterfaceDataItem CreateInterfaceDataItem (SysId interfaceId, SaInterfaceProcessDirection direction, ItemId itemId, String externalReference)
|
||||
public override SaInterfaceDataItem CreateInterfaceDataItem(SysId interfaceId, SaInterfaceProcessDirection direction, ItemId itemId, String externalReference)
|
||||
{
|
||||
return new SaInterfaceDataItem_Dbas(null, interfaceId, direction, itemId, externalReference, 0);
|
||||
}
|
||||
private SaInterfaceDataItem CreateInterfaceDataItem (SaInterfaceDataItem_Db dbInterfaceDataItem)
|
||||
private SaInterfaceDataItem CreateInterfaceDataItem(SaInterfaceDataItem_Db dbInterfaceDataItem)
|
||||
{
|
||||
ClearErrorState();
|
||||
SaInterfaceDataItem interfaceDataItem = new SaInterfaceDataItem_Dbas(new SysId(dbInterfaceDataItem._Id), new SysId(dbInterfaceDataItem._InterfaceId), (SaInterfaceProcessDirection)dbInterfaceDataItem._Direction, new ItemId(dbInterfaceDataItem._ItemType, new SysId(dbInterfaceDataItem._ItemId)), dbInterfaceDataItem._ExternalRef, (ushort)dbInterfaceDataItem._Flags);
|
||||
PopulateFrom(dbInterfaceDataItem, interfaceDataItem);
|
||||
return interfaceDataItem;
|
||||
}
|
||||
private SaInterfaceDataItem CreateInterfaceDataItem (DbDataReader dataReader)
|
||||
private SaInterfaceDataItem CreateInterfaceDataItem(DbDataReader dataReader)
|
||||
{
|
||||
SaInterfaceDataItem_Db dbInterfaceDataItem = new SaInterfaceDataItem_Db(DbInfo);
|
||||
dbInterfaceDataItem.PopulateFrom(dataReader);
|
||||
@@ -40,7 +40,7 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item exists.
|
||||
public override bool InterfaceDataItemExistsById (SysId id)
|
||||
public override bool InterfaceDataItemExistsById(SysId id)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!SysId.IsValid(id)) return false;
|
||||
@@ -49,11 +49,11 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Get Item.
|
||||
public override SaInterfaceDataItem GetInterfaceDataItem (SaInterfaceDataItem.Params prm)
|
||||
public override SaInterfaceDataItem GetInterfaceDataItem(SaInterfaceDataItem.Params prm)
|
||||
{
|
||||
return GetInterfaceDataItem(GetInterfaceDataItemQueryFilter(prm).Concat(" AND ", "(", ")"));
|
||||
}
|
||||
private SaInterfaceDataItem GetInterfaceDataItem (String filter)
|
||||
private SaInterfaceDataItem GetInterfaceDataItem(String filter)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (GetInterfaceDataItemCount(filter) != 1) return null;
|
||||
@@ -71,12 +71,13 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
SaLogger.Warn(GetType().Name + ".GetInterfaceDataItem\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
|
||||
SetErrorState("Database query exception");
|
||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||
}
|
||||
}
|
||||
return interfaceProcessDataItem;
|
||||
}
|
||||
public override SaInterfaceDataItem GetInterfaceDataItemById (SysId id)
|
||||
public override SaInterfaceDataItem GetInterfaceDataItemById(SysId id)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!SysId.IsValid(id)) return null;
|
||||
@@ -85,7 +86,7 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate Item properties.
|
||||
public override bool IsValidInterfaceDataItemData (SaInterfaceDataItem.Data interfaceData, SaInterfaceDataItem.ErrField errField)
|
||||
public override bool IsValidInterfaceDataItemData(SaInterfaceDataItem.Data interfaceData, SaInterfaceDataItem.ErrField errField)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!base.IsValidInterfaceDataItemData(interfaceData, errField)) return false;
|
||||
@@ -94,7 +95,7 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Insert Item.
|
||||
public override bool InsertInterfaceDataItem (SaInterfaceDataItem interfaceProcessDataItem, DbUpdateInfo dbUpdateInfo)
|
||||
public override bool InsertInterfaceDataItem(SaInterfaceDataItem interfaceProcessDataItem, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!IsValidInterfaceDataItem(interfaceProcessDataItem)) return false;
|
||||
@@ -122,7 +123,7 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update Item.
|
||||
public override bool UpdateInterfaceDataItem (SaInterfaceDataItem interfaceProcessDataItem, DbUpdateInfo dbUpdateInfo)
|
||||
public override bool UpdateInterfaceDataItem(SaInterfaceDataItem interfaceProcessDataItem, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!IsValidInterfaceDataItem(interfaceProcessDataItem)) return false;
|
||||
@@ -147,13 +148,13 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete Item.
|
||||
public override bool InterfaceDataItemCanBeDeleted (SaInterfaceDataItem interfaceProcessDataItem)
|
||||
public override bool InterfaceDataItemCanBeDeleted(SaInterfaceDataItem interfaceProcessDataItem)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!base.InterfaceDataItemCanBeDeleted(interfaceProcessDataItem)) return false;
|
||||
return true;
|
||||
}
|
||||
public override bool DeleteInterfaceDataItem (SaInterfaceDataItem interfaceProcessDataItem, DbUpdateInfo dbUpdateInfo)
|
||||
public override bool DeleteInterfaceDataItem(SaInterfaceDataItem interfaceProcessDataItem, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!InterfaceDataItemCanBeDeleted(interfaceProcessDataItem)) return false;
|
||||
@@ -178,7 +179,7 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Copy data properties to and from database.
|
||||
private void PopulateTo (SaInterfaceDataItem_Db dbInterfaceDataItem, SaInterfaceDataItem interfaceProcessDataItem, DbUpdateInfo dbUpdateInfo)
|
||||
private void PopulateTo(SaInterfaceDataItem_Db dbInterfaceDataItem, SaInterfaceDataItem interfaceProcessDataItem, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
dbInterfaceDataItem._Id = interfaceProcessDataItem.Id.ToInt();
|
||||
dbInterfaceDataItem._InterfaceId = SysId.ToInt(interfaceProcessDataItem.InterfaceId);
|
||||
@@ -205,7 +206,7 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
dbInterfaceDataItem._UpdateBy = dbUpdateInfo.UserId.ToInt();
|
||||
dbInterfaceDataItem._UpdateHost = dbUpdateInfo.Host;
|
||||
}
|
||||
private void PopulateFrom (SaInterfaceDataItem_Db dbInterfaceDataItem, SaInterfaceDataItem interfaceProcessDataItem)
|
||||
private void PopulateFrom(SaInterfaceDataItem_Db dbInterfaceDataItem, SaInterfaceDataItem interfaceProcessDataItem)
|
||||
{
|
||||
//interface.Id = new SysId(dbInterfaceDataItem._Id);
|
||||
//interfaceProcessDataItem.InterfaceId = new SysId(dbInterfaceDataItem._InterfaceId);
|
||||
@@ -227,7 +228,7 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Column definitions.
|
||||
private static readonly String aliasInterfaceDataItem = "aIntPrcDit";
|
||||
private static readonly String aliasInterfaceDataItem = "aIntPrcDit";
|
||||
private void SetInterfaceDataItemColDfn
|
||||
(ColumnDfn col, String caption, int width, SaInterfaceDbDfn.ColumnIdx dbCol,
|
||||
ColumnAlignment align = ColumnAlignment.Default, DataValue.DataType dataType = DataValue.DataType.String,
|
||||
@@ -237,9 +238,9 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
alias = aliasInterfaceDataItem;
|
||||
col.Set(caption, width, (int)dbCol, prefix + SaInterfaceDbDfn.GetColumnName(dbCol, false), SaInterfaceDbDfn.GetColumnNameQual(dbCol, alias), dataType, align);
|
||||
}
|
||||
public override ColumnDfn GetInterfaceDataItemColumnDfn (SaInterfaceDataItem.Column columnId, string caption = "", int width = 0)
|
||||
public override ColumnDfn GetInterfaceDataItemColumnDfn(SaInterfaceDataItem.Column columnId, string caption = "", int width = 0)
|
||||
{
|
||||
ColumnDfn columnDfn = new ColumnDfn((int)columnId,caption,width);
|
||||
ColumnDfn columnDfn = new ColumnDfn((int)columnId, caption, width);
|
||||
switch (columnId)
|
||||
{
|
||||
case SaInterfaceDataItem.Column.Pos:
|
||||
@@ -388,7 +389,7 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Query filter.
|
||||
public override List<string> GetInterfaceDataItemQueryFilter (SaInterfaceDataItem.Params prm)
|
||||
public override List<string> GetInterfaceDataItemQueryFilter(SaInterfaceDataItem.Params prm)
|
||||
{
|
||||
List<String> filter = new List<String>();
|
||||
|
||||
@@ -451,7 +452,7 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
return filter;
|
||||
}
|
||||
// Sort columns.
|
||||
public List<String> GetInterfaceDataItemSortColumns (SaInterfaceDataItem.Params prm)
|
||||
public List<String> GetInterfaceDataItemSortColumns(SaInterfaceDataItem.Params prm)
|
||||
{
|
||||
// Sort sequence:
|
||||
List<String> sortColumnNames = new List<String>();
|
||||
@@ -493,12 +494,12 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item count.
|
||||
private long GetInterfaceDataItemCount (String filter)
|
||||
private long GetInterfaceDataItemCount(String filter)
|
||||
{
|
||||
ClearErrorState();
|
||||
return Database.GetRowCount(TableName_InterfaceDataItem + " As " + aliasInterfaceDataItem, filter);
|
||||
}
|
||||
public override long GetInterfaceDataItemCount (SaInterfaceDataItem.Params prm)
|
||||
public override long GetInterfaceDataItemCount(SaInterfaceDataItem.Params prm)
|
||||
{
|
||||
ClearErrorState();
|
||||
return GetInterfaceDataItemCount(GetInterfaceDataItemQueryFilter(prm).Concat(" AND ", "(", ")"));
|
||||
@@ -506,8 +507,9 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item list.
|
||||
public override List<SaInterfaceDataItem> GetInterfaceDataItemList (SaInterfaceDataItem.Params prm)
|
||||
public override List<SaInterfaceDataItem> GetInterfaceDataItemList(SaInterfaceDataItem.Params prm)
|
||||
{
|
||||
ClearErrorState();
|
||||
List<SaInterfaceDataItem> interfaces = new List<SaInterfaceDataItem>();
|
||||
DbQuery qry = new DbQuery(Database.DbmsType);
|
||||
qry.Tables.Add(TableName_InterfaceDataItem, aliasInterfaceDataItem);
|
||||
@@ -531,7 +533,8 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
SaLogger.Warn(GetType().Name + ".GetInterfaceDataItemList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
|
||||
SetErrorState("Database query exception");
|
||||
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
|
||||
}
|
||||
}
|
||||
return interfaces;
|
||||
@@ -539,7 +542,7 @@ namespace Sarand.Net.Standard.Dbas.Interfaces
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item query.
|
||||
public override DbResultSet ExecuteInterfaceDataItemQuery (List<ColumnDfn> columns, SaInterfaceDataItem.Params prm)
|
||||
public override DbResultSet ExecuteInterfaceDataItemQuery(List<ColumnDfn> columns, SaInterfaceDataItem.Params prm)
|
||||
{
|
||||
ClearErrorState();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user