53 lines
1.7 KiB
C#
53 lines
1.7 KiB
C#
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
|
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
|
using Sarand.Net.Standard.Base.Bus;
|
|
using Sarand.Net.Standard.Base.Dbas;
|
|
using System;
|
|
|
|
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Bus
|
|
{
|
|
//=======================================================================
|
|
class SbmConstituent_Dbas : SbmConstituent
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
private readonly SbmInternals internals;
|
|
|
|
//-------------------------------------------------------------------
|
|
// Construction.
|
|
public SbmConstituent_Dbas(SbmInternals internals, SysId id, SysId affIdOwner, SysId assocId, Sbm.ConstituentType constituentType, ushort flags) :
|
|
base(internals.UserContext, id, affIdOwner, assocId, constituentType)
|
|
{
|
|
this.internals = internals;
|
|
Flags = flags;
|
|
}
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing)
|
|
{
|
|
// NB Do not dispose the Internals - owned by manager.
|
|
}
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Properties.
|
|
|
|
//-------------------------------------------------------------------
|
|
// Associated data.
|
|
public override bool HasConstituents()
|
|
{
|
|
if (!SysId.IsValid(Id)) return false;
|
|
ISacsDatabase db = SbmGlobals.Application.GetBusMgrDatabase(internals.SessionContext);
|
|
if (db != null)
|
|
{
|
|
String filter = SbmDbDfn.GetColumnName(SbmDbDfn.ColumnIdx.Constituent_ConstId) + "=" + Id.ToString();
|
|
return db.GetRowCount(SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.Constituent), filter) > 0;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
}
|
|
//=======================================================================
|
|
}
|