protected void GetAlertDataSource(object sender, ObjectDataSourceEventArgs e)
        {
            if (_dataSource == null)
            {
                _dataSource = new AlertDataSource();

                _dataSource.AlertFoundSet += delegate(IList <AlertSummary> newlist)
                {
                    AlertItems = new AlertItemCollection(newlist);
                };
            }

            e.ObjectInstance = _dataSource;

            if (DataSourceCreated != null)
            {
                DataSourceCreated(_dataSource);
            }
        }
Exemple #2
0
        void DeleteAllConfirmDialog_Confirmed(object data)
        {
            AlertsGridPanel.RefreshCurrentPage();

            AlertController controller = new AlertController();

            AlertItemCollection items = AlertsGridPanel.AlertItems;

            bool successful = false;

            for (int i = 0; i < items.Count; i++)
            {
                successful = controller.DeleteAlert(items[i].TheAlertItem);
                if (!successful)
                {
                    break;
                }
            }

            if (successful)
            {
                Platform.Log(LogLevel.Info, "All Alert items deleted by user.");
            }
            else
            {
                Platform.Log(LogLevel.Error,
                             "PreResetConfirmDialog_Confirmed: Unable to delete all Alert items.");

                MessageBox.Message     = ErrorMessages.AlertDeleteFailed;
                MessageBox.MessageType =
                    MessageBox.MessageTypeEnum.ERROR;
                MessageBox.Show();
            }

            OnAllAlertsDeleted();
        }