64 lines
2.7 KiB
C#
64 lines
2.7 KiB
C#
using Sarand.BusinessMgr.Net.Standard.Base.App;
|
|
using Sarand.BusinessMgr.Net.Standard.Base.Bus;
|
|
using Sarand.BusinessMgr.Net.Standard.Base.UpdateLog;
|
|
using Sarand.Net.Standard.Base.App;
|
|
using Sarand.Net.Standard.Base.Bus;
|
|
|
|
namespace Sarand.BusinessMgr.Net.Standard.Dbas.UpdateLog
|
|
{
|
|
//=======================================================================
|
|
public class SbmUpdateLogItemMonitor_CommodityCustomer : SbmUpdateLogItemMonitor
|
|
{
|
|
//-------------------------------------------------------------------
|
|
// Configuration.
|
|
public new class Config : SbmUpdateLogItemMonitor.Config
|
|
{
|
|
public Config(SbmInternals internals, SysId itemId) :
|
|
base(internals)
|
|
{
|
|
ItemType = (short)Sbm.ItemType.CommodityCustomer;
|
|
ItemId = itemId;
|
|
}
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Data members.
|
|
|
|
//-------------------------------------------------------------------
|
|
// Construction.
|
|
public SbmUpdateLogItemMonitor_CommodityCustomer(SbmInternals internals, SbmCommodityCustomer commodityCustomer) :
|
|
base(new Config(internals, commodityCustomer.Id))
|
|
{
|
|
RecordAttrValues(commodityCustomer, false);
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
// Record attribute values.
|
|
public bool RecordUpdatedValues(SbmCommodityCustomer commodityCustomer)
|
|
{
|
|
return RecordAttrValues(commodityCustomer, true);
|
|
}
|
|
private bool RecordAttrValues(SbmCommodityCustomer commodityCustomer, bool newValues)
|
|
{
|
|
ClearErrorState();
|
|
|
|
// CommodityCustomer Properties - record values that may require logging.
|
|
RecordAttrValue(SbmDbDfn.ColumnIdx.CommodityCustomer_CommodityId, SysId.ToInt(commodityCustomer.CommodityId), newValues);
|
|
RecordAttrValue(SbmDbDfn.ColumnIdx.CommodityCustomer_AssocIdCustomer, SysId.ToInt(commodityCustomer.AssocIdCustomer), newValues);
|
|
RecordAttrValue(SbmDbDfn.ColumnIdx.CommodityCustomer_ProductCode, commodityCustomer.ProductCode, newValues);
|
|
RecordAttrValue(SbmDbDfn.ColumnIdx.CommodityCustomer_AmountRetail, commodityCustomer.AmountRetail, newValues);
|
|
RecordAttrValue(SbmDbDfn.ColumnIdx.CommodityCustomer_CurrencyIdRetail, SysId.ToInt(commodityCustomer.CurrencyIdRetail), newValues);
|
|
RecordAttrValue(SbmDbDfn.ColumnIdx.CommodityCustomer_PromotionCode, commodityCustomer.PromotionCode, newValues);
|
|
|
|
// Common properties.
|
|
RecordAttrValue(SbmDbDfn.ColumnIdx.CommodityCustomer_Notes, commodityCustomer.Notes, newValues);
|
|
RecordAttrValue(SbmDbDfn.ColumnIdx.CommodityCustomer_Status, SacsSystem.GetStatusCode(commodityCustomer.Status), newValues);
|
|
|
|
return OK;
|
|
}
|
|
|
|
//-------------------------------------------------------------------
|
|
}
|
|
//=======================================================================
|
|
}
|