private void AddMeasurementsButton_Click(object sender, RoutedEventArgs e)
        {
            int count = AvailableMeasurementsPager.SelectedMeasurements.Count;

            if (count > 1000)
            {
                string message =
                    $"You have selected {count} measurements. " +
                    $"It may take some time to complete this operation. " +
                    $"Would you like to continue?";

                if (!m_dataContext.Confirm(message, "Too many measurements"))
                {
                    return;
                }
            }

            if (AllowedTab.IsSelected)
            {
                m_dataContext.AddAllowedMeasurements(AvailableMeasurementsPager.SelectedMeasurements);
                AllowedMeasurementsPager.ReloadDataGrid();
            }
            else
            {
                m_dataContext.AddDeniedMeasurements(AvailableMeasurementsPager.SelectedMeasurements);
                DeniedMeasurementsPager.ReloadDataGrid();
            }

            AvailableMeasurementsPager.ClearSelections();
        }
 private void RemoveMeasurementsButton_Click(object sender, RoutedEventArgs e)
 {
     if (AllowedTab.IsSelected)
     {
         m_dataContext.RemoveAllowedMeasurements(AllowedMeasurementsPager.SelectedMeasurements);
         AllowedMeasurementsPager.ReloadDataGrid();
         AllowedMeasurementsPager.ClearSelections();
     }
     else
     {
         m_dataContext.RemoveDeniedMeasurements(DeniedMeasurementsPager.SelectedMeasurements);
         DeniedMeasurementsPager.ReloadDataGrid();
         DeniedMeasurementsPager.ClearSelections();
     }
 }
        private void UpdateFilterExpressions()
        {
            Subscriber currentItem = m_dataContext.CurrentItem;

            AllowedMeasurementsPager.FilterExpression = string.Format("SignalID IN (SELECT SignalID FROM SubscriberMeasurement WHERE NodeID = '{0}' AND SubscriberID = '{1}' AND Allowed <> 0)", currentItem.NodeID.ToString().ToLower(), currentItem.ID.ToString().ToLower());
            DeniedMeasurementsPager.FilterExpression  = string.Format("SignalID IN (SELECT SignalID FROM SubscriberMeasurement WHERE NodeID = '{0}' AND SubscriberID = '{1}' AND Allowed = 0)", currentItem.NodeID.ToString().ToLower(), currentItem.ID.ToString().ToLower());

            if (AllowedMeasurementsPager.IsLoaded)
            {
                AllowedMeasurementsPager.ReloadDataGrid();
            }

            if (DeniedMeasurementsPager.IsLoaded)
            {
                DeniedMeasurementsPager.ReloadDataGrid();
            }
        }