43 lines
1.5 KiB
C#
43 lines
1.5 KiB
C#
using BeWo.Data.Entities;
|
|
|
|
using BS.Shared.DataContracts;
|
|
|
|
namespace BeWo.Service.DCEntityMapper
|
|
{
|
|
public class InvoiceNumberDC_InvoiceNumber : AbstractIDCEntityMapper<InvoiceNumber, InvoiceNumberDC>
|
|
{
|
|
public override InvoiceNumberDC MergeWithDC(InvoiceNumber pEntity, InvoiceNumberDC pDataContract)
|
|
{
|
|
pDataContract.InvoiceNumberOid = pEntity.Oid;
|
|
pDataContract.InvoiceNumberVersion = pEntity.Version;
|
|
pDataContract.CurrentNumber = pEntity.CurrentNumber;
|
|
pDataContract.Pattern = pEntity.Pattern;
|
|
pDataContract.Use = pEntity.Use;
|
|
pDataContract.Name = pEntity.Notice;
|
|
|
|
return pDataContract;
|
|
}
|
|
|
|
public override InvoiceNumber MergeWithEntity(InvoiceNumberDC pDataContract, InvoiceNumber pEntity)
|
|
{
|
|
this.ConcurrencyCheck(pDataContract.InvoiceNumberVersion, pEntity);
|
|
|
|
pEntity.CurrentNumber = pDataContract.CurrentNumber;
|
|
pEntity.Pattern = pDataContract.Pattern;
|
|
pEntity.Use = pDataContract.Use;
|
|
pEntity.Notice = pDataContract.Name;
|
|
|
|
return pEntity;
|
|
}
|
|
|
|
protected override bool AreDCAndEntityEqual(InvoiceNumberDC pDC, InvoiceNumber pEntity)
|
|
{
|
|
if (pDC.InvoiceNumberOid == null)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return pDC.InvoiceNumberOid == pEntity.Oid;
|
|
}
|
|
}
|
|
} |