private StrcutureSystem SetBoilerList(LayoutColumn valueSplitted, StrcutureSystem structure)
        {
            var boilerFund = structure.BoilerList.Find(c => c.ModelName == valueSplitted.ModelName);

            if (boilerFund == null)
            {
                var item = new Boiler()
                {
                    InstallationArea = valueSplitted.Area,
                    ModelName        = valueSplitted.ModelName
                };
                if (!string.IsNullOrEmpty(valueSplitted.Value))
                {
                    if (item.BoilerValue == null)
                    {
                        item.BoilerValue = new List <BoilerValue>();
                    }
                    if (item.BoilerValue.Count == 0)
                    {
                        BoilerValue boilerValue = new BoilerValue();
                        boilerValue.LabelValues = new List <string>()
                        {
                            valueSplitted.Value
                        };
                        item.BoilerValue.Add(boilerValue);
                    }
                }
                structure.BoilerList.Add(item);
            }
            else
            {
                if (!string.IsNullOrEmpty(valueSplitted.Value))
                {
                    var valueBag = boilerFund.BoilerValue.LastOrDefault();
                    if (valueBag != null && !valueBag.LabelValues.Contains(valueSplitted.Value))
                    {
                        valueBag.LabelValues.Add(valueSplitted.Value);
                    }
                }
            }
            return(structure);
        }
        private StrcutureSystem SetDateInAllStructure(StrcutureSystem structure, string value)
        {
            if (structure.CogeneratorList.Count > 0)
            {
                foreach (var cogenerator in structure.CogeneratorList)
                {
                    if (cogenerator.CogeneratorValue.Count > 0)
                    {
                        if (cogenerator.CogeneratorValue.FirstOrDefault().DetectionDate == DateTime.MinValue)
                        {
                            cogenerator.CogeneratorValue.FirstOrDefault().DetectionDate = DateTime.Parse(value);
                        }
                        else
                        {
                            var backup = cogenerator.CogeneratorValue.FirstOrDefault();
                            CogeneratoreValue newBag = new CogeneratoreValue();
                            newBag.LabelValues   = new List <string>();
                            newBag.LabelValues   = backup.LabelValues;
                            newBag.DetectionDate = DateTime.Parse(value);
                            cogenerator.CogeneratorValue.Add(newBag);
                        }
                    }
                }
            }

            if (structure.SensorList.Count > 0)
            {
                foreach (var sensor in structure.SensorList)
                {
                    if (sensor.PumpSensorList != null && sensor.PumpSensorList.Count > 0)
                    {
                        if (sensor.PumpSensorList.FirstOrDefault().DetectionDate == DateTime.MinValue)
                        {
                            sensor.PumpSensorList.FirstOrDefault().DetectionDate = DateTime.Parse(value);
                        }
                        else
                        {
                            var        backup = sensor.PumpSensorList.FirstOrDefault();
                            PumpSensor newBag = new PumpSensor();
                            newBag.LabelValues   = new List <string>();
                            newBag.LabelValues   = backup.LabelValues;
                            newBag.DetectionDate = DateTime.Parse(value);
                            sensor.PumpSensorList.Add(newBag);
                        }
                    }
                    if (sensor.EnergyMeterList != null && sensor.EnergyMeterList.Count > 0)
                    {
                        if (sensor.EnergyMeterList.FirstOrDefault().DetectionDate == DateTime.MinValue)
                        {
                            sensor.EnergyMeterList.FirstOrDefault().DetectionDate = DateTime.Parse(value);
                        }
                        else
                        {
                            var         backup = sensor.EnergyMeterList.FirstOrDefault();
                            EnergyMeter newBag = new EnergyMeter();
                            newBag.LabelValues   = new List <string>();
                            newBag.LabelValues   = backup.LabelValues;
                            newBag.DetectionDate = DateTime.Parse(value);
                            sensor.EnergyMeterList.Add(newBag);
                        }
                    }
                }
            }

            if (structure.BoilerList.Count > 0)
            {
                foreach (var boiler in structure.BoilerList)
                {
                    if (boiler.BoilerValue.Count > 0)
                    {
                        if (boiler.BoilerValue.FirstOrDefault().DetectionDate == DateTime.MinValue)
                        {
                            boiler.BoilerValue.FirstOrDefault().DetectionDate = DateTime.Parse(value);
                        }
                        else
                        {
                            var         backup = boiler.BoilerValue.FirstOrDefault();
                            BoilerValue newBag = new BoilerValue();
                            newBag.LabelValues   = new List <string>();
                            newBag.LabelValues   = backup.LabelValues;
                            newBag.DetectionDate = DateTime.Parse(value);
                            boiler.BoilerValue.Add(newBag);
                        }
                    }
                }
            }

            if (structure.HeatPumpList.Count > 0)
            {
                foreach (var heatPump in structure.HeatPumpList)
                {
                    if (heatPump.HeatPumpValue.Count > 0)
                    {
                        if (heatPump.HeatPumpValue.FirstOrDefault().DetectionDate == DateTime.MinValue)
                        {
                            heatPump.HeatPumpValue.FirstOrDefault().DetectionDate = DateTime.Parse(value);
                        }
                        else
                        {
                            var           backup = heatPump.HeatPumpValue.FirstOrDefault();
                            HeatPumpValue newBag = new HeatPumpValue();
                            newBag.LabelValues   = new List <string>();
                            newBag.LabelValues   = backup.LabelValues;
                            newBag.DetectionDate = DateTime.Parse(value);
                            heatPump.HeatPumpValue.Add(newBag);
                        }
                    }
                }
            }

            //TODO ABSORBER

            return(structure);
        }