Exemplo n.º 1
0
        private PotentialBusinessEntry MakeBusinessEntry([NotNull] StandortAnalysis sa,
                                                         [NotNull] House h,
                                                         [NotNull][ItemNotNull] List <Hausanschluss> hausanschlusses)
        {
            var    houseGuid    = h.Guid;
            var    businessGuid = Guid.NewGuid().ToString();
            var    businessName = sa.BusinessPartnerName;
            var    complexName  = h.ComplexName;
            var    lowVoltageYearlyElectricityUse          = sa.LowVoltageTotalElectricity;
            var    highVoltageYearlyElectricityUse         = sa.HighVoltageTotalElectricity;
            var    lowVoltageYearlyElectricityUseDaytime   = sa.LowVoltageElectricityUseDaytime;
            var    lowVoltageYearlyElectricityUseNighttime = sa.LowVoltageElectricityUseNighttime;
            string hausanschlussGuid = h.GetHausanschlussByIsn(sa.OriginalISNs, sa.Standort, hausanschlusses, Services.Logger)?.Guid ??
                                       throw new FlaException("no hausanschluss");
            var be = new PotentialBusinessEntry(houseGuid,
                                                businessGuid,
                                                businessName,
                                                complexName,
                                                lowVoltageYearlyElectricityUse,
                                                highVoltageYearlyElectricityUse,
                                                lowVoltageYearlyElectricityUseDaytime,
                                                lowVoltageYearlyElectricityUseNighttime,
                                                sa.GasUse,
                                                sa.FernWärme,
                                                sa.SummerBaseGasUse,
                                                -1,
                                                sa.LocalNetEntries.Count,
                                                sa.ElectricityTarif,
                                                sa.BusinessCategory,
                                                hausanschlussGuid);

            be.Standort = sa.Standort;
            be.LowVoltageLocalnetEntries  = sa.LowVoltageElectricityEntries;
            be.HighVoltageLocalnetEntries = sa.HighVoltageElectricityEntries;
            be.NumberOfLocalnetEntries    = sa.LowVoltageElectricityEntries.Count + sa.HighVoltageElectricityEntries.Count;
            be.Tarif = sa.ElectricityTarif;
            return(be);
        }
Exemplo n.º 2
0
        private static PotentialBusinessEntry MakeBusinessEntry([NotNull] StandortAnalysis sa, [NotNull] House h, [NotNull][ItemNotNull] List <Hausanschluss> hausanschlusses)
        {
            var houseGuid    = h.HouseGuid;
            var businessGuid = Guid.NewGuid().ToString();
            var businessName = sa.BusinessPartnerName;
            var complexName  = h.ComplexName;
            var lowVoltageYearlyElectricityUse          = sa.LowVoltageTotalElectricity;
            var highVoltageYearlyElectricityUse         = sa.HighVoltageTotalElectricity;
            var lowVoltageYearlyElectricityUseDaytime   = sa.LowVoltageElectricityUseDaytime;
            var lowVoltageYearlyElectricityUseNighttime = sa.LowVoltageElectricityUseNighttime;

            string hausanschlussGuid = hausanschlusses.Single(x => x.Isn == sa.IsnID).HausanschlussGuid;
            var    be = new PotentialBusinessEntry(houseGuid, businessGuid, businessName, complexName, lowVoltageYearlyElectricityUse, highVoltageYearlyElectricityUse,
                                                   lowVoltageYearlyElectricityUseDaytime, lowVoltageYearlyElectricityUseNighttime, sa.GasUse, sa.FernWärme,
                                                   sa.SummerLowVoltageBaseElectricity, sa.SummerBaseGasUse, false,
                                                   -1, sa.LocalNetEntries.Count, sa.ElectricityTarif, sa.BusinessCategory, hausanschlussGuid);

            be.Standorte.Add(sa.Standort);
            be.LowVoltageLocalnetEntries = sa.LowVoltageElectricityEntries;
            be.NumberOfLocalnetEntries   = sa.LowVoltageElectricityEntries.Count + sa.HighVoltageElectricityEntries.Count;
            be.Tarif = sa.ElectricityTarif;
            return(be);
        }