50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
using BeWo.Data.Access;
|
|
using BeWo.Data.Entities;
|
|
using BS.Shared;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.DataContracts;
|
|
|
|
namespace BeWo.Service.DCEntityMapper
|
|
{
|
|
public class RatingDC_Rating : AbstractIDCEntityMapper<Rating, RatingDC>
|
|
{
|
|
public override RatingDC MergeWithDC(Rating pEntity, RatingDC pDataContract)
|
|
{
|
|
pDataContract.RatingOid = pEntity.Oid;
|
|
pDataContract.RatingVersion = pEntity.Version;
|
|
pDataContract.Notice = pEntity.Notice;
|
|
pDataContract.RTFNotice = pEntity.RTFNotice;
|
|
pDataContract.DisplayName = pEntity.DisplayName;
|
|
pDataContract.StartDate = pEntity.StartDate;
|
|
|
|
pDataContract.GoalRatingList = MapperFactory.GoalRatingDC_GoalRating.MapToNewDCs(pEntity.GoalRatingList);
|
|
|
|
return pDataContract;
|
|
}
|
|
|
|
public override Rating MergeWithEntity(RatingDC pDataContract, Rating pEntity)
|
|
{
|
|
ConcurrencyCheck(pDataContract.RatingVersion, pEntity);
|
|
|
|
pEntity.Oid = pDataContract.RatingOid;
|
|
pEntity.Notice = pDataContract.Notice;
|
|
pEntity.RTFNotice = pDataContract.RTFNotice;
|
|
pEntity.DisplayName = pDataContract.DisplayName;
|
|
pEntity.StartDate = pDataContract.StartDate;
|
|
|
|
MapperFactory.GoalRatingDC_GoalRating.MergeWithEntitys(pDataContract.GoalRatingList, pEntity.GoalRatingList);
|
|
|
|
return pEntity;
|
|
}
|
|
|
|
protected override bool AreDCAndEntityEqual(RatingDC pDC, Rating pEntity)
|
|
{
|
|
if (pDC.RatingOid == null)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return pDC.RatingOid == pEntity.Oid;
|
|
}
|
|
}
|
|
} |