/// <summary>
 /// A method to insert a new Adapter
 /// </summary>
 /// <param name="VibratingCurve">An adapter entity with information about the new adapter</param>
 public void insert(SensorHub.Model.NKVibratingCurveInfo VibratingCurve)
 {
     if (string.IsNullOrEmpty(VibratingCurve.DEVID))
     {
         return;
     }
     SensorHub.IDAL.INKVibratingCurve dal = SensorHub.DALFactory.NKVibratingCurve.Create();
     dal.insert(VibratingCurve);
 }
Esempio n. 2
0
        public void insert(SensorHub.Model.NKVibratingCurveInfo vibratingCurve)
        {
            OracleParameter[] parms = GetAdapterParameters();

            SetAdapterParameters(parms, vibratingCurve);

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