using System.IO;
using BeWo.Data.Entities;

using BS.Shared.DataContracts;

namespace BeWo.Service.DCEntityMapper
{
    public class SignatureDC_Signature : AbstractIDCEntityMapper<Signature, SignatureDC>
    {
        public override SignatureDC MergeWithDC(Signature pEntity, SignatureDC pDataContract)
        {
          
            pDataContract.ServiceRecordOid = pEntity.ServiceRecordOid;
            pDataContract.Latitute = pEntity.Latitute;
            pDataContract.Longitute = pEntity.Longitute;
            pDataContract.DataBild = pEntity.DataBild;
            pDataContract.Zeitstempel = pEntity.Zeitstempel;
        
            return pDataContract;
        }

        public override Signature MergeWithEntity(SignatureDC pDataContract, Signature pEntity)
        {
            pEntity.ServiceRecordOid = pDataContract.ServiceRecordOid;
            pEntity.Latitute = pDataContract.Latitute;
            pEntity.Longitute = pDataContract.Longitute;
            pEntity.DataBild = pDataContract.DataBild;
            pEntity.Zeitstempel = pDataContract.Zeitstempel;

            return pEntity;
        }

       protected override bool AreDCAndEntityEqual(SignatureDC pDC, Signature pEntity)
        {
            
            if (pDC.ServiceRecordOid == null)
            {
                return false;
            }

            return pDC.ServiceRecordOid == pEntity.ServiceRecordOid;
        }
    }
}