/// <summary>
        /// Method to update alarm information.
        /// </summary>
        /// <param name="entityObject"></param>
        /// <returns></returns>
        protected override PuckAlarm Update(PuckAlarm entityObject)
        {
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_NS_PUCKALARM);

            cmd.Parameters.AddWithValue("action", "U");
            cmd.Parameters.AddWithValue("AlarmID", entityObject.AlarmID);
            cmd.Parameters.AddWithValue("AlarmActive", entityObject.AlarmActive);
            CDAO.ExecScalar(cmd);
            return(entityObject);
        }
Esempio n. 2
0
        protected override NotificationCurrentStatusCommand ExecuteCommand()
        {
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_NS_ALARMCURRENTSTATUS);

            cmd.Parameters.AddWithValue("action", "U");
            cmd.Parameters.AddWithValue("UTID", this.UTID);
            cmd.Parameters.AddWithValue("Probe", this.Probe);
            CDAO.ExecScalar(cmd);
            return(this);
        }
        protected override ServiceEntity Update(ServiceEntity entityObject)
        {
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_SERVICE);

            cmd.Parameters.AddWithValue("action", "U");
            cmd.Parameters.AddWithValue("PID", entityObject.PID);
            CDAO.ConnectionString = entityObject.ExeName;
            CDAO.ExecScalar(cmd);
            return(entityObject);
        }
Esempio n. 4
0
        /// <summary>
        /// Method to update isElapsed value to database based on UTID,Probe for which isElapsed is false.
        /// </summary>
        /// <param name="entityObject"></param>
        /// <returns></returns>
        protected override AlarmObject Update(AlarmObject entityObject)
        {
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_NS_ALARMCURRENTSTATUS);

            cmd.Parameters.AddWithValue("action", "U");
            cmd.Parameters.AddWithValue("UTID", entityObject.UTID);
            cmd.Parameters.AddWithValue("Probe", entityObject.Probe);
            CDAO.ExecScalar(cmd);
            return(entityObject);
        }
        protected override ServiceEntity Insert(ServiceEntity entityObject)
        {
            /* Initializing the command object. */
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_SERVICE);

            cmd.Parameters.AddWithValue("action", "C");

            /*Bind parameters to command object.*/
            BindParameters(cmd, entityObject);

            /* Executing the procedure.*/
            CDAO.ExecScalar(cmd);

            return(entityObject);
        }
        protected override FailsafeEscalation ExecuteCommand()
        {
            /* Initialize the command object*/
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_NS_GETFAILSAFEINFO, System.Data.CommandType.StoredProcedure);

            cmd.AddWithValue("StoreID", StoreID);
            cmd.AddWithValue("AlarmID", AlarmID);
            cmd.AddWithValue("UTID", UTID);
            cmd.AddWithValue("AlarmType", AlarmType);
            cmd.AddWithValue("Probe", Probe);

            object count = CDAO.ExecScalar(cmd);

            /*If the procedure returns count more than zero, consider it as the sensor comes to the normal range.*/
            SensorIsInRange = count.ToInt() > 0;

            return(this);
        }