public HausAnschlussRo AddHausanschluss([NotNull] House house, [NotNull] Hausanschluss hausanschluss, [NotNull] string haStatus)
        {
            string  housename         = house.ComplexName;
            string  hausanschlussName = hausanschluss.Adress;
            string  objectId          = hausanschluss.ObjectID;
            string  trafokreis        = hausanschluss.Trafokreis;
            string  hausanschlussGuid = hausanschluss.Guid;
            HouseRo housero           = Houses.Single(x => x.HouseName == housename);

            if (housero.HausAnschlussList.Any(x => x.HausanschlussGuid == hausanschlussGuid))
            {
                throw new FlaException("Hausanschluss already exists:" + objectId);
            }

            HausAnschlussRo haro = new HausAnschlussRo(hausanschlussName, objectId, trafokreis, hausanschlussGuid, hausanschluss.Isn.ToString(),
                                                       hausanschluss.Lon, hausanschluss.Lat, haStatus, hausanschluss.Standort);

            housero.HausAnschlussList.Add(haro);
            haro.AssignmentMethod   = hausanschluss.MatchingType.ToString();
            haro.AssignmentDistance = hausanschluss.Distance;
            if (!_hausanschlussByObjectId.ContainsKey(objectId))
            {
                _hausanschlussByObjectId.Add(objectId, new List <HausAnschlussRo>());
            }
            _hausanschlussByObjectId[objectId].Add(haro);
            return(haro);
        }
        public RowBuilder ToRowBuilder([NotNull] HouseRo house, [NotNull] HausAnschlussRo hausAnschluss, XlsResultOutputMode mode)
        {
            var rb = RowBuilder.GetAllProperties(this);

            if (mode == XlsResultOutputMode.FullLine)
            {
                rb.Merge(hausAnschluss.ToRowBuilder(house, mode));
            }
            return(rb);
        }
        public void AddHouse([NotNull] House house)
        {
            string houseName = house.ComplexName;

            if (Houses.Any(x => x.HouseName == houseName))
            {
                throw new FlaException("House already exists");
            }

            var houseRo = new HouseRo(houseName, house.WgsGwrCoordsAsJson, house.LocalWgsPointsAsJson, house.StandortIDsAsJson,
                                      house.ErzeugerIDsAsJson, house.Adress);

            _houseRosByHouse.Add(house, houseRo);
            Houses.Add(houseRo);
        }
        public RowBuilder ToRowBuilder([CanBeNull] HouseRo house, XlsResultOutputMode mode)
        {
            var rb = RowBuilder.Start("Hausanschluss Name", HausAnschlussName);

            rb.Add("ObjektID", ObjektID);
            rb.Add("Trafokreis", Trafokreis);
            rb.Add("Hausanschluss Energy During the Night", HausanschlussEnergyDuringNight);
            rb.Add("Hausanschluss Energy During the Day", HausanschlussEnergyDuringDay);
            rb.Add("ISNs", Isns);
            rb.Add("House Assignment Method", AssignmentMethod);
            rb.Add("Assignment Distance", AssignmentDistance);
            rb.Add("Longitude", Lon);
            rb.Add("Latitude", Lat);
            rb.Add("Hausanschluss Status", HaStatus);
            rb.Add("Maximum Anschluss Power", MaximumPower);
            rb.Add("HAStandort", HaStandort);

            if (mode == XlsResultOutputMode.FullLine && house != null)
            {
                rb.Merge(house.ToRowBuilder());
            }

            return(rb);
        }