Esempio n. 1
0
        public void InsertNewTestRun(DBTestRun pTestRun)
        {
            try {
                using (NpgsqlConnection pDBConnection = new NpgsqlConnection(__sConnectionString)) {
                    pDBConnection.Open();


                    string sInsert = string.Format("INSERT INTO {0} ({1}, {2}, {3},{4}) VALUES (@sSensorMatNum,@pDate,@fMeasuredmV,@bSucceeded)",
                                                   DBNames.TestRunTable.TableName, DBNames.TestRunTable.Columns.sensor_matnum, DBNames.TestRunTable.Columns.date, DBNames.TestRunTable.Columns.measured_mv,
                                                   DBNames.TestRunTable.Columns.succeeded);

                    // Insert some data
                    using (NpgsqlCommand cmd = new NpgsqlCommand(sInsert, pDBConnection)) {
                        cmd.Parameters.AddWithValue("sSensorMatNum", pTestRun.SensorMaterialNumber);
                        cmd.Parameters.AddWithValue("pDate", pTestRun.EpochStart);
                        cmd.Parameters.AddWithValue("fMeasuredmV", pTestRun.MeasuredValuemV);
                        cmd.Parameters.AddWithValue("bSucceeded", pTestRun.Succeeded);
                        cmd.ExecuteNonQuery();
                    }
                }
            }
            catch (Exception e) {
                //todo: Add logging
            }
        }
Esempio n. 2
0
 public void UpdateTestRun(DBTestRun pUpdateRun)
 {
     throw new NotImplementedException();
 }