public void insert(SensorHub.Model.NKStressCurveInfo stressCurve) { OracleParameter[] parms = GetAdapterParameters(); SetAdapterParameters(parms, stressCurve); try { OracleHelper.ExecuteNonQuery(OracleHelper.ConnectionStringOrderDistributedTransaction, CommandType.Text, SQL_INSERT_NK_GX_STRESS_CURVE, parms); } catch (Exception e) { throw (e); } }
/// <summary> /// An internal function to bind values parameters for insert /// </summary> /// <param name="parms">Database parameters</param> /// <param name="stressCurve">Values to bind to parameters</param> private void SetAdapterParameters(OracleParameter[] parms, SensorHub.Model.NKStressCurveInfo stressCurve) { parms[0].Value = stressCurve.DEVID; if (null != stressCurve.DISTANCE) { parms[1].Value = stressCurve.DISTANCE; } else { parms[1].Value = DBNull.Value; } if (null != stressCurve.STRESS) { parms[2].Value = stressCurve.STRESS; } else { parms[2].Value = DBNull.Value; } if (null != stressCurve.UPTIME) { parms[3].Value = stressCurve.UPTIME; } else { parms[3].Value = DBNull.Value; } if (null != stressCurve.LOGTIME) { parms[4].Value = stressCurve.LOGTIME; } else { parms[4].Value = DBNull.Value; } }