52 lines
1.6 KiB
C#
52 lines
1.6 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 SbmUserContext userContext;
|
|
|
|
//-------------------------------------------------------------------
|
|
// Construction.
|
|
public SbmConstituent_Dbas(SbmUserContext userContext, SysId id, SysId affIdOwner, SysId assocId, Sbm.ConstituentType constituentType, ushort flags) :
|
|
base(userContext, id, affIdOwner, assocId, constituentType)
|
|
{
|
|
this.userContext = userContext;
|
|
Flags = flags;
|
|
}
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing)
|
|
{
|
|
}
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Properties.
|
|
|
|
//-------------------------------------------------------------------
|
|
// Associated data.
|
|
public override bool HasConstituents()
|
|
{
|
|
if (!SysId.IsValid(Id)) return false;
|
|
ISacsDatabase db = SbmGlobals.Application.GetDatabase(userContext.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;
|
|
}
|
|
|
|
}
|
|
//=======================================================================
|
|
}
|