using BS.Shared.DataContracts; namespace BeWo.ViewModel { public class InvoiceNumberVM : AbstractDCMapperVM { #region Constants and Fields public static string PropertyName_CurrentNumber = "CurrentNumber"; public static string PropertyName_Pattern = "Pattern"; public static string PropertyName_Use = "Use"; public static string PropertyName_Name = "Name"; private long _CurrentNumber; private string _Pattern; private bool _Use; private string _Name; #endregion #region Constructors and Destructors public InvoiceNumberVM(InvoiceNumberDC pDC) : base(pDC, !pDC.InvoiceNumberOid.HasValue) {} #endregion #region Properties public long CurrentNumber { get { return this._CurrentNumber; } set { if (this.AreDifferent(this._CurrentNumber, value)) { this._CurrentNumber = value; this.StoreDirtyInformation(this.AreDifferent(this.DataContract.CurrentNumber, value), PropertyName_CurrentNumber); this.FirePropertyChanged(PropertyName_CurrentNumber); } } } public string Pattern { get { return this._Pattern; } set { if (this.AreDifferent(this._Pattern, value)) { this._Pattern = value; this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Pattern, value), PropertyName_Pattern); this.FirePropertyChanged(PropertyName_Pattern); } } } public bool Use { get { return this._Use; } set { if (this.AreDifferent(this._Use, value)) { this._Use = value; this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Use, value), PropertyName_Use); this.FirePropertyChanged(PropertyName_Use); } } } public string Name { get { return this._Name; } set { if (this.AreDifferent(this._Name, value)) { this._Name = value; this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Name, value), PropertyName_Name); this.FirePropertyChanged(PropertyName_Name); } } } #endregion #region Methods protected override void InitByDataContract(InvoiceNumberDC pDataContract) { this._Use = pDataContract.Use; this._CurrentNumber = pDataContract.CurrentNumber; this._Pattern = pDataContract.Pattern; this._Name = pDataContract.Name; } protected override InvoiceNumberDC MapToDataContract(InvoiceNumberDC pDataContract, bool doCommit) { pDataContract.CurrentNumber = this._CurrentNumber; pDataContract.Pattern = this._Pattern; pDataContract.Use = this._Use; pDataContract.Name = this._Name; return this.DataContract; } #endregion } }