public Household([JetBrains.Annotations.NotNull] PotentialHousehold ph) { HouseGuid = ph.HouseGuid; Guid = ph.Guid; MonthlyEnergyUseIDsAsJson = ph.MonthlyEnergyUseIDsAsJson; if (ph.Standort == null) { throw new FlaException("standort was null"); } Standort = ph.Standort; LocalnetLowVoltageYearlyTotalElectricityUse = ph.YearlyElectricityUse; Tarif = ph.Tarif; LocalnetEntriesAsJson = ph.LocalnetEntriesAsJson; NumberOfLocalnetEntries = ph.NumberOfLocalnetEntries; HouseholdKey = ph.HouseholdKey; BusinessPartnerName = ph.BusinessPartnerName; OriginalISNs = LocalnetEntries.Select(x => x.ObjektIDGebäude ?? -1).Distinct().ToList(); HausAnschlussGuid = ph.HausAnschlussGuid; Name = ph.BusinessPartnerName; if (LocalnetEntries.Any(x => x.Tarif == "MS")) { throw new FlaException("Haushalt mit Mittelspannungsanschluss ist unsinn."); } }
public BusinessEntry([JetBrains.Annotations.NotNull] PotentialBusinessEntry p, BusinessType businessType) { HouseGuid = p.HouseGuid; Guid = p.Guid; BusinessName = p.BusinessName; LocalnetLowVoltageYearlyTotalElectricityUse = p.LowVoltageYearlyElectricityUse; LowVoltageYearlyElectricityUseDaytime = p.LowVoltageYearlyElectricityUseDaytime; LowVoltageYearlyElectricityUseNighttime = p.LowVoltageYearlyElectricityUseNighttime; LocalnetHighVoltageYearlyTotalElectricityUse = p.HighVoltageYearlyElectricityUse; YearlyGasUse = p.YearlyGasUse; YearlyFernwärmeUse = p.YearlyFernwärmeUse; SummerbaseGasUse = p.SummerbaseGasUse; BusinessType = businessType; Standort = p.Standort; Employees = p.Employees; LocalnetEntriesAsJson = p.LocalnetLowVoltageEntriesAsJson; LocalnetEntries.AddRange(p.HighVoltageLocalnetEntries); NumberOfLocalnetEntries = p.NumberOfLocalnetEntries; Tarif = p.Tarif; MyCategory = p.MyCategory; ComplexName = p.ComplexName; if (LocalnetEntries.Count == 0) { throw new FlaException("No localnet entries were found for this business?" + BusinessName); } OriginalISNs = LocalnetEntries.Select(x => x.ObjektIDGebäude ?? -1).Distinct().ToList(); if (LocalnetEntries.Any(x => x.Tarif == "MS")) { IsMittelSpannungsAnschluss = true; } else { IsMittelSpannungsAnschluss = false; } HausAnschlussGuid = p.HausAnschlussGuid; Name = p.BusinessName; HouseComponentType = HouseComponentType.BusinessNoLastgangLowVoltage; EnergyType = EnergyType.Electricity; }