/// <summary>
        /// Method to insert alarm information.
        /// </summary>
        /// <param name="entityObject"></param>
        /// <returns></returns>
        protected override PuckAlarm Insert(PuckAlarm entityObject)
        {
            /* Initializing the command object. */
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_NS_PUCKALARM);

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

            /* Declaring AlarmID  as output parameter.*/
            CSqlDbParamter alarmIdParam = new CSqlDbParamter("AlarmID");

            alarmIdParam.Direction = System.Data.ParameterDirection.InputOutput;
            alarmIdParam.DbType    = System.Data.DbType.Int32;
            alarmIdParam.Value     = entityObject.AlarmID;

            cmd.Parameters.Add(alarmIdParam);

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

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

            entityObject.AlarmID = Convert.ToInt32(CDAO.Parameters["AlarmID"].Value);
            return(entityObject);
        }
Exemple #2
0
        protected override NotificationProcessResume ExecuteCommand()
        {
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_NS_DORESUMEPROCESS, System.Data.CommandType.StoredProcedure);

            cmd.AddWithValue("StoreID", StoreID);

            CDAO.ExecCommand(cmd);

            return(this);
        }
        /// <summary>
        /// Method to delete alarm information.
        /// </summary>
        /// <param name="criteria"></param>
        /// <returns></returns>
        protected override int Remove(Criteria criteria)
        {
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_NS_PUCKALARM);

            cmd.Parameters.AddWithValue("action", "R");
            cmd.Parameters.AddWithValue("AlarmID", criteria.ID);
            int i = CDAO.ExecCommand(cmd);

            return(i);
        }
        protected override IVRClearInProcessFlags ExecuteCommand()
        {
            //Initialize the CSqlDbCommand for execute the stored procedure
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_NS_IVR_CLEARINPROCESS);

            //Execute command
            CDAO.ExecCommand(cmd);

            return(this);
        }
Exemple #5
0
        protected override NotificationRemover ExecuteCommand()
        {
            /*Initialize the command.*/
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_NS_REMOVE_NOTIFICATION, System.Data.CommandType.StoredProcedure);

            /*add parameters to command object*/
            cmd.AddWithValue("StoreID", StoreID);
            cmd.AddWithValue("NotificationID", NotificationID);

            /*execute command*/
            CDAO.ExecCommand(cmd);

            return(this);
        }
Exemple #6
0
        /// <summary>
        /// Method to insert current alarm status into the database
        /// </summary>
        /// <param name="entityObject"></param>
        /// <returns></returns>
        protected override AlarmObject Insert(AlarmObject entityObject)
        {
            /* Initializing the command object. */
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_NS_ALARMCURRENTSTATUS);

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

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

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

            return(entityObject);
        }
Exemple #7
0
        protected override AlarmNote ExecuteCommand()
        {
            /*Initialize the command.*/
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_NS_ADDNOTE, System.Data.CommandType.StoredProcedure);

            /*add parameters to command object*/
            cmd.AddWithValue("AlarmID", AlarmID);
            cmd.AddWithValue("Message", Message);
            cmd.AddWithValue("NoteType", NoteType);
            cmd.AddWithValue("StoreID", StoreID);

            /*execute command*/
            CDAO.ExecCommand(cmd);

            return(this);
        }
        protected override NotificationStatusUpdate ExecuteCommand()
        {
            /*Initialize the command.*/
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_NS_UPDATENOTIFICATIONSTATUS, System.Data.CommandType.StoredProcedure);

            /*add parameters to command object*/
            cmd.AddWithValue("StoreID", StoreID);
            cmd.AddWithValue("NotificationID", NotificationID);
            // This stored procedure was changed to an integer because on SQL 2000 the bit was being sent as a 'T' or an 'F' instead of a 1 or 0
            cmd.AddWithValue("IsProcessCompleted", Convert.ToInt32(IsProcessCompleted));

            /*execute command*/
            CDAO.ExecCommand(cmd);

            return(this);
        }
Exemple #9
0
        /// <summary>
        /// Record Notification
        /// </summary>
        /// <returns></returns>
        protected override RecordNotification ExecuteCommand()
        {
            //Initialize the CSqlDbCommand for execute the stored procedure
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_NS_RECORDNOTIFICATION, System.Data.CommandType.StoredProcedure);

            cmd.AddWithValue("NotificationID", NotificationID);
            cmd.AddWithValue("TransID", TransID);
            cmd.AddWithValue("Status", (int)Status);
            cmd.AddWithValue("LogText", LogText);
            cmd.AddWithValue("NotifyType", (int)this.NotifyType);

            //Execute command
            CDAO.ExecCommand(cmd);

            //Close the data reader.
            CDAO.CloseDataReader();

            CDAO.Dispose();
            //return filled object.
            return(this);
        }
Exemple #10
0
        protected override TTIvrNotifications ExecuteCommand()
        {
            //Initialize the CSqlDbCommand for execute the stored procedure
            CSqlDbCommand cmd = new CSqlDbCommand(DBCommands.USP_NS_IVR_RECORDIVRNOTIFICATION);

            //Add action parameter (C -Create), for insert new record in the database table
            cmd.AddWithValue("Action", Action);

            //Bind TTIVRNotifications entity property values as input parameters for procedure
            BindParams(cmd, this);

            //Execute command
            CDAO.ExecCommand(cmd);

            //Bind output values to TTIVRNotifications object
            this.RecID       = Convert.ToInt32(CDAO.Parameters["RecID"].Value);
            this.TransID     = Convert.ToInt32(CDAO.Parameters["TransID"].Value);
            this.PhoneNumber = CDAO.Parameters["PhoneNumber"].Value.ToStr();
            this.isInProcess = Convert.ToInt16(CDAO.Parameters["isInProcess"].Value);
            //return TTIVRNotifications object
            return(this);
        }