Mappings
This commit is contained in:
@@ -298,6 +298,10 @@ namespace BeWo.Service.DCEntityMapper
|
||||
|
||||
private static BargeldtransaktionshistoryDC_Bargeldtransaktionshistory _BargeldtransaktionshistoryDC_Bargeldtransaktionshistory;
|
||||
|
||||
private static WohneinheitDC_Wohneinheit _WohneinheitDC_Wohneinheit;
|
||||
|
||||
private static WohneinheitBelegungDC_WohneinheitBelegung _WohneinheitBelegungDC_WohneinheitBelegung;
|
||||
|
||||
public static MedRecordDC_MedRecord MedRecordDC_MedRecord =>
|
||||
_MedRecordDC_MedRecord ?? (_MedRecordDC_MedRecord = new MedRecordDC_MedRecord());
|
||||
|
||||
@@ -748,5 +752,11 @@ namespace BeWo.Service.DCEntityMapper
|
||||
|
||||
public static BargeldtransaktionshistoryDC_Bargeldtransaktionshistory BargeldtransaktionshistoryDC_Bargeldtransaktionshistory =>
|
||||
_BargeldtransaktionshistoryDC_Bargeldtransaktionshistory ?? (_BargeldtransaktionshistoryDC_Bargeldtransaktionshistory = new BargeldtransaktionshistoryDC_Bargeldtransaktionshistory());
|
||||
|
||||
public static WohneinheitDC_Wohneinheit WohneinheitDC_Wohneinheit =>
|
||||
_WohneinheitDC_Wohneinheit ?? (_WohneinheitDC_Wohneinheit = new WohneinheitDC_Wohneinheit());
|
||||
|
||||
public static WohneinheitBelegungDC_WohneinheitBelegung WohneinheitBelegungDC_WohneinheitBelegung =>
|
||||
_WohneinheitBelegungDC_WohneinheitBelegung ?? (_WohneinheitBelegungDC_WohneinheitBelegung = new WohneinheitBelegungDC_WohneinheitBelegung());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
|
||||
namespace BeWo.Service.DCEntityMapper
|
||||
{
|
||||
public class WohneinheitBelegungDC_WohneinheitBelegung : AbstractIDCEntityMapper<WohneinheitBelegung, WohneinheitBelegungDC>
|
||||
{
|
||||
public virtual List<WohneinheitBelegungDC> MapToNewDCs(IEnumerable<WohneinheitBelegung> pEntitys, WohneinheitDC dc)
|
||||
{
|
||||
var lResult = new List<WohneinheitBelegungDC>();
|
||||
if (pEntitys != null)
|
||||
{
|
||||
foreach (WohneinheitBelegung iEntity in pEntitys)
|
||||
{
|
||||
lResult.Add(MergeWithDC(iEntity, CreateNewDC(), dc));
|
||||
}
|
||||
}
|
||||
return lResult;
|
||||
}
|
||||
|
||||
public override WohneinheitBelegungDC MergeWithDC(WohneinheitBelegung pEntity, WohneinheitBelegungDC pDataContract)
|
||||
{
|
||||
throw new NotImplementedException("Logik fehlt.");
|
||||
|
||||
var wohneinheit = MapperFactory.WohneinheitDC_Wohneinheit.MapToNewDC(pEntity.Wohneinheit);
|
||||
|
||||
return MergeWithDC(pEntity, pDataContract, wohneinheit);
|
||||
}
|
||||
|
||||
public WohneinheitBelegungDC MergeWithDC(WohneinheitBelegung pEntity, WohneinheitBelegungDC pDataContract, WohneinheitDC wohneinheit)
|
||||
{
|
||||
pDataContract.Customer = MapperFactory.CustomerDC_Customer.MapToNewDC(pEntity.Customer);
|
||||
|
||||
pDataContract.Wohneinheit = wohneinheit;
|
||||
|
||||
pDataContract.Oid = pEntity.Oid;
|
||||
pDataContract.IsActive = pEntity.IsActive;
|
||||
pDataContract.Notice = pEntity.Notice;
|
||||
pDataContract.InsTs = pEntity.InsTs;
|
||||
pDataContract.InsUser = pEntity.InsUser;
|
||||
pDataContract.Version = pEntity.Version;
|
||||
pDataContract.UdpUser = pEntity.UdpUser;
|
||||
pDataContract.SystemEntryID = pEntity.SystemEntryID;
|
||||
pDataContract.StartDate = pEntity.StartDate;
|
||||
pDataContract.EndDate = pEntity.EndDate;
|
||||
pDataContract.Kommentar = pEntity.Kommentar;
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
public override WohneinheitBelegung MergeWithEntity(WohneinheitBelegungDC pDataContract, WohneinheitBelegung pEntity)
|
||||
{
|
||||
pEntity.Oid = pDataContract.Oid;
|
||||
pEntity.IsActive = pDataContract.IsActive;
|
||||
pEntity.Notice = pDataContract.Notice;
|
||||
pEntity.InsTs = pDataContract.InsTs;
|
||||
pEntity.InsUser = pDataContract.InsUser;
|
||||
pEntity.Version = pDataContract.Version;
|
||||
pEntity.UdpUser = pDataContract.UdpUser;
|
||||
pEntity.SystemEntryID = pDataContract.SystemEntryID;
|
||||
pEntity.StartDate = pDataContract.StartDate;
|
||||
pEntity.EndDate = pDataContract.EndDate;
|
||||
pEntity.Kommentar = pDataContract.Kommentar;
|
||||
|
||||
pEntity.Customer = DAOFactory.GenericDAO.GetByID<Customer>(pDataContract.Customer.CustomerOid.Value);
|
||||
pEntity.Wohneinheit = DAOFactory.GenericDAO.GetByID<Wohneinheit>(pDataContract.Wohneinheit.Oid.Value);
|
||||
|
||||
return pEntity;
|
||||
}
|
||||
|
||||
protected override bool AreDCAndEntityEqual(WohneinheitBelegungDC pDC, WohneinheitBelegung pEntity)
|
||||
{
|
||||
if (pDC.Oid == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return pDC.Oid == pEntity.Oid;
|
||||
}
|
||||
}
|
||||
}
|
||||
89
Service/DCEntityMapper/WohneinheitDC_Wohneinheit.cs
Normal file
89
Service/DCEntityMapper/WohneinheitDC_Wohneinheit.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BeWo.Data.Access;
|
||||
using BeWo.Data.Entities;
|
||||
using BeWo.Service.ServiceImplementations;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
|
||||
namespace BeWo.Service.DCEntityMapper
|
||||
{
|
||||
public class WohneinheitDC_Wohneinheit : AbstractIDCEntityMapper<Wohneinheit, WohneinheitDC>
|
||||
{
|
||||
public override WohneinheitDC MergeWithDC(Wohneinheit pEntity, WohneinheitDC pDataContract)
|
||||
{
|
||||
pDataContract.Oid = pEntity.Oid;
|
||||
pDataContract.IsActive = pEntity.IsActive;
|
||||
pDataContract.Notice = pEntity.Notice;
|
||||
pDataContract.InsTs = pEntity.InsTs;
|
||||
pDataContract.InsUser = pEntity.InsUser;
|
||||
pDataContract.Version = pEntity.Version;
|
||||
pDataContract.UdpUser = pEntity.UdpUser;
|
||||
pDataContract.SystemEntryID = pEntity.SystemEntryID;
|
||||
|
||||
pDataContract.Wohnname = pEntity.Wohnname;
|
||||
pDataContract.Zimmername = pEntity.Zimmername;
|
||||
pDataContract.Miete = pEntity.Miete;
|
||||
pDataContract.Heizung = pEntity.Heizung;
|
||||
pDataContract.Strom = pEntity.Strom;
|
||||
pDataContract.Betriebskosten = pEntity.Betriebskosten;
|
||||
pDataContract.SonstigeKosten = pEntity.SonstigeKosten;
|
||||
pDataContract.QM = pEntity.QM;
|
||||
pDataContract.Baujahr = pEntity.Baujahr;
|
||||
pDataContract.Mobilierung = pEntity.Mobilierung;
|
||||
pDataContract.Zusatznotiz = pEntity.Zusatznotiz;
|
||||
pDataContract.Stock = pEntity.Stock;
|
||||
|
||||
pDataContract.Wohnheim = MapperFactory.WohnheimDC_Wohnheim.MapToNewDC(pEntity.Wohnheim);
|
||||
|
||||
if (pEntity.Belegungen is object && pEntity.Belegungen.Any())
|
||||
pDataContract.Belegungen = MapperFactory.WohneinheitBelegungDC_WohneinheitBelegung.MapToNewDCs(pEntity.Belegungen, pDataContract);
|
||||
|
||||
return pDataContract;
|
||||
}
|
||||
|
||||
public override Wohneinheit MergeWithEntity(WohneinheitDC pDataContract, Wohneinheit pEntity)
|
||||
{
|
||||
pEntity.Oid = pDataContract.Oid;
|
||||
pEntity.IsActive = pDataContract.IsActive;
|
||||
pEntity.Notice = pDataContract.Notice;
|
||||
pEntity.InsTs = pDataContract.InsTs;
|
||||
pEntity.InsUser = pDataContract.InsUser;
|
||||
pEntity.Version = pDataContract.Version;
|
||||
pEntity.UdpUser = pDataContract.UdpUser;
|
||||
pEntity.SystemEntryID = pDataContract.SystemEntryID;
|
||||
|
||||
pEntity.Wohnname = pDataContract.Wohnname;
|
||||
pEntity.Zimmername = pDataContract.Zimmername;
|
||||
pEntity.Miete = pDataContract.Miete;
|
||||
pEntity.Heizung = pDataContract.Heizung;
|
||||
pEntity.Strom = pDataContract.Strom;
|
||||
pEntity.Betriebskosten = pDataContract.Betriebskosten;
|
||||
pEntity.SonstigeKosten = pDataContract.SonstigeKosten;
|
||||
pEntity.QM = pDataContract.QM;
|
||||
pEntity.Baujahr = pDataContract.Baujahr;
|
||||
pEntity.Mobilierung = pDataContract.Mobilierung;
|
||||
pEntity.Zusatznotiz = pDataContract.Zusatznotiz;
|
||||
pEntity.Stock = pDataContract.Stock;
|
||||
|
||||
pEntity.Wohnheim = DAOFactory.GenericDAO.LoadByID<Wohnheim>(pDataContract.Wohnheim.WohnheimOid.Value);
|
||||
|
||||
if (pEntity.Belegungen is null)
|
||||
pEntity.Belegungen = new List<WohneinheitBelegung>();
|
||||
|
||||
MapperFactory.WohneinheitBelegungDC_WohneinheitBelegung.MergeWithEntitys(pDataContract.Belegungen, pEntity.Belegungen);
|
||||
|
||||
return pEntity;
|
||||
}
|
||||
|
||||
protected override bool AreDCAndEntityEqual(WohneinheitDC pDC, Wohneinheit pEntity)
|
||||
{
|
||||
if (pDC.Oid == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return pDC.Oid == pEntity.Oid;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -327,9 +327,11 @@
|
||||
<Compile Include="DCEntityMapper\SupportConceptApprovalPeriodEmployeeRelDC_SupportConceptApprovalPeriod2Employee.cs" />
|
||||
<Compile Include="DCEntityMapper\VertretungDC_Vertretung.cs" />
|
||||
<Compile Include="DCEntityMapper\VorlagentabelleDC_Vorlagentabelle.cs" />
|
||||
<Compile Include="DCEntityMapper\WohneinheitBelegungDC_WohneinheitBelegung.cs" />
|
||||
<Compile Include="DCEntityMapper\Wohnheimbuchung2Costbearer2SupportConceptRelDC_Wohnheimbuchung2Costbearer2SupportConcept.cs" />
|
||||
<Compile Include="DCEntityMapper\WohnheimbuchungDC_Wohnheimbuchung.cs" />
|
||||
<Compile Include="DCEntityMapper\WohnheimCustomerRelDC_Customer2WohnheimMapper.cs" />
|
||||
<Compile Include="DCEntityMapper\WohneinheitDC_Wohneinheit.cs" />
|
||||
<Compile Include="DCEntityMapper\WohnheimEmployeeRelDC_Employee2WohnheimMapper.cs" />
|
||||
<Compile Include="DCEntityMapper\WohnheimDC_Wohnheim.cs" />
|
||||
<Compile Include="DCEntityMapper\TextModuleDC_TextModule.cs" />
|
||||
|
||||
Reference in New Issue
Block a user