Exemplo n.º 1
0
        /// <summary>
        /// Delete the current Alert from the database
        /// </summary>
        public void Delete()
        {
            // Delete from the database
            AlertsDAO lwDataAccess = new AlertsDAO();

            lwDataAccess.AlertDelete(this);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Dismiss this alert
        /// </summary>
        public void Dismiss()
        {
            AlertsDAO lwDataAccess = new AlertsDAO();

            Status = AlertStatus.dismissed;
            lwDataAccess.AlertSetStatus(this);
        }
Exemplo n.º 3
0
        public int Add()
        {
            // Add from the database
            AlertsDAO lwDataAccess = new AlertsDAO();

            _alertID = lwDataAccess.AlertAdd(this);
            return(_alertID);
        }
Exemplo n.º 4
0
        public int Populate(DateTime dtSince)
        {
            // Ensure that the list is empty initially
            this.Clear();

            AlertsDAO lwDataAccess = new AlertsDAO();
            DataTable table        = lwDataAccess.EnumerateAlerts(dtSince);

            // Iterate through the returned rows in the table and create AssetType objects for each
            foreach (DataRow row in table.Rows)
            {
                AddAlert(row);
            }
            return(this.Count);
        }