Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="device"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        static public object Insert(XD202Device device, XD202Data data)
        {
            string sql = "insert into tblMeasureSluiceData(DeviceID, DT, BeforeWL, BehindWL, InstantFlux, Height, UsedAmount, RemainedAmount) " +
                         "values(@DeviceID, @DT, @BeforeWL, @BehindWL, @InstantFlux, @Height, @UsedAmount, @RemainedAmount)";

            SqlCommand   cmd = new SqlCommand(sql);
            SqlParameter p   = null;

            p = new SqlParameter("@DeviceID", device.ID);
            cmd.Parameters.Add(p);

            p = new SqlParameter("@DT", data.DT);
            cmd.Parameters.Add(p);

            AddParameter(cmd, "@BeforeWL", data.BeforeWaterLevel);
            AddParameter(cmd, "@BehindWL", data.BehindWaterLevel);
            AddParameter(cmd, "@InstantFlux", data.InstantFlux);
            AddParameter(cmd, "@Height", data.Height);
            AddParameter(cmd, "@RemainedAmount", data.RemainAmount);
            AddParameter(cmd, "@UsedAmount", 0);
            return(CSDBI.CSDB.ExecuteScalar(cmd));
        }
Beispiel #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="device"></param>
        /// <param name="data"></param>
        /// <returns></returns>
        public static object Insert(XD202Device device, XD202Data data)
        {
            string sql = "insert into tblMeasureSluiceData(DeviceID, DT, BeforeWL, BehindWL, InstantFlux, Height, UsedAmount, RemainedAmount) " +
                "values(@DeviceID, @DT, @BeforeWL, @BehindWL, @InstantFlux, @Height, @UsedAmount, @RemainedAmount)";

            SqlCommand cmd = new SqlCommand(sql);
            SqlParameter p = null;

            p = new SqlParameter("@DeviceID", device.ID);
            cmd.Parameters.Add(p);

            p = new SqlParameter("@DT", data.DT);
            cmd.Parameters.Add(p);

            AddParameter(cmd, "@BeforeWL", data.BeforeWaterLevel);
            AddParameter(cmd, "@BehindWL", data.BehindWaterLevel );
            AddParameter(cmd, "@InstantFlux", data.InstantFlux);
            AddParameter(cmd, "@Height", data.Height);
            AddParameter(cmd, "@RemainedAmount", data.RemainAmount);
            AddParameter(cmd, "@UsedAmount", 0);
            return CSDBI.Instance.ExecuteScalar(cmd);
        }