64 lines
2.0 KiB
C#
64 lines
2.0 KiB
C#
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
|
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
|
using Sarand.BusinessMgr.Net.Standard.Base.Mgr;
|
|
using Sarand.Net.Standard.Base.Bus;
|
|
using Sarand.Net.Standard.Base.Core;
|
|
using Sarand.Net.Standard.Base.Dbas;
|
|
using Sarand.Net.Standard.Base.Utils;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Sarand.BusinessMgr.Net.Standard.Dbas.Bus
|
|
{
|
|
//=======================================================================
|
|
class SbmPriceSet_Dbas : SbmPriceSet
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
private readonly SbmInternals internals;
|
|
|
|
//-------------------------------------------------------------------
|
|
// Construction.
|
|
public SbmPriceSet_Dbas(SbmInternals internals, SysId id, SysId affiliateIdOwner, String reference, Sbm.PriceType priceType, ushort flags) :
|
|
base(internals.UserContext, id, affiliateIdOwner, reference, priceType)
|
|
{
|
|
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 HasPrices()
|
|
{
|
|
ClearErrorState();
|
|
if (!SysId.IsValid(Id)) return false;
|
|
ISacsDatabase db = internals.BusMgrDatabase;
|
|
if (db != null)
|
|
{
|
|
String tablePrice = SbmDbDfn.GetTableName(SbmDbDfn.TableIdx.SaPrice);
|
|
if (db.TableExists(tablePrice))
|
|
{
|
|
List<String> filter = new List<String>();
|
|
filter.Add(SbmDbDfn.GetColumnName(SbmDbDfn.ColumnIdx.SaPrice_PriceSetId) + "=" + SysId.ToString(Id));
|
|
return db.GetRowCount(tablePrice, filter.Concat(" AND ", "(", ")")) > 0;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|