static public void Save(Business.Arrays.MeasureUnitArray values)
        {
            _serializer.ClearBinary();
            for (int i = 0; i < values.List.Size; ++i)
            {
                if (Exists(values.List[i]))
                {
                    MessageBox.Show("Value: " + values.List[i].Measure.Name + "( " + values.List[i].Unit.Name + ") alredy exists.");
                    continue;
                }

                if (values.List[i].IdMeasureUnit == -1)
                {
                    values.List[i].IdMeasureUnit = FilesConfigurations.MeasuresUnitId();
                    FilesConfigurations.PlusMeasuresUnitId();
                }

                _serializer.SaveData(ConvertToFile(values.List[i]));
            }
        }
示例#2
0
        static public void Save(Business.Arrays.SensorDataArray values)
        {
            _serializer.ClearBinary();
            for (int i = 0; i < values.List.Size; ++i)
            {
                if (Exists(values.List[i]))
                {
                    MessageBox.Show("Value: " + values.List[i].SensorName + " alredy exists.");
                    continue;
                }

                if (values.List[i].IdSensor == -1)
                {
                    values.List[i].IdSensor = FilesConfigurations.SensorDataId();
                    FilesConfigurations.PlusSensorDataId();
                }

                _serializer.SaveData(ConvertToFile(values.List[i]));
            }
        }
示例#3
0
        static public void Save(Business.Arrays.MeasureArray values)
        {
            _serializer.ClearBinary();
            for (int i = 0; i < values.List.Size; ++i)
            {
                if (Exists(values.List[i]))
                {
                    MessageBox.Show("Value: " + values.List[i].Name + " alredy exists.");
                    continue;
                }

                if (values.List[i].IdMeasure == -1)
                {
                    values.List[i].IdMeasure = FilesConfigurations.MeasuresId();
                    FilesConfigurations.PlusMeasuresId();
                }

                Debug.WriteLine("IdActual: " + values.List[i].IdMeasure);
                _serializer.SaveData(ConvertToFile(values.List[i]));
            }
        }