Ejemplo n.º 1
0
        public static void AddRecordingSet(RCCFLib.Records.RecordingSet recordingSet)
        {
            LinqObjectsDataContext dataContext = new LinqObjectsDataContext();

            RecordingSet newRecordingSet = new RecordingSet();

            newRecordingSet.RecordingSetDateTime = recordingSet.RecordingSetDateTime;
            newRecordingSet.RecordingSetId       = recordingSet.RecordingSetId;
            newRecordingSet.RecordingRunId       = recordingSet.RecordingRunId;

            dataContext.RecordingSets.InsertOnSubmit(newRecordingSet);

            foreach (Records.Recording thisRecording in recordingSet.Recordings)
            {
                Recording newRecording = new Recording();
                newRecording.Key            = thisRecording.Key;
                newRecording.RecordingSetId = recordingSet.RecordingSetId;
                switch (thisRecording.Type)
                {
                case Records.ValueType.DateTime:
                    newRecording.DateTimeValue = DateTime.Parse(thisRecording.Value.ToString());
                    break;

                case Records.ValueType.Float:
                    newRecording.FloatValue = float.Parse(thisRecording.Value.ToString());
                    break;

                case Records.ValueType.Integer:
                    newRecording.IntValue = Int32.Parse(thisRecording.Value.ToString());
                    break;

                case Records.ValueType.String:
                    newRecording.StringValue = thisRecording.Value.ToString();
                    break;

                default:
                    break;
                }

                dataContext.Recordings.InsertOnSubmit(newRecording);
            }

            dataContext.SubmitChanges();
        }
Ejemplo n.º 2
0
 partial void UpdateRecordingSet(RecordingSet instance);
Ejemplo n.º 3
0
 partial void DeleteRecordingSet(RecordingSet instance);
Ejemplo n.º 4
0
 partial void InsertRecordingSet(RecordingSet instance);