Exemple #1
0
        /// <summary>
        /// Stored procedure wrapper
        /// Adds a new position for a single node to the database
        /// </summary>
        /// <param name="row">The data to be added containing the position</param>
        private void AddPosition(DataRow row)
        {
            string AddPosition = "call addPosition(" + row["ID"].ToString() + ", '"
                                 + row["Time"].ToString() + "', " + row["AN"].ToString() + ", " + row["X"].ToString() + ", " + row["Y"].ToString() + ")";

            MySQLConn.Query(AddPosition);
        }
Exemple #2
0
        /// <summary>
        /// Stored procedure wrapper
        /// Adds a new position for a single node to the database
        /// </summary>
        /// <param name="wsnID">The WSNID of the node</param>
        /// <param name="position">The position in a point type</param>
        /// <param name="anchor">Anchor node or Blind Node</param>
        private void AddPosition(DataRow row, Point pos, int anchor)
        {
            string AddPosition = "call addPosition(" + row["ID"].ToString() + ", '"
                                 + row["Time"].ToString() + "', " + anchor + ", ";

            if (pos != null)
            {
                AddPosition += pos.x.ToString().Replace(',', '.') + ", " + pos.y.ToString().Replace(',', '.') + ")";
            }
            else
            {
                AddPosition += "null, null )";
            }

            MySQLConn.Query(AddPosition);
        }