示例#1
0
        private void Save_Device(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            TreeViewItem save = ((sender as TreeView).SelectedItem as TreeViewItem);
            //MessageBox.Show(lbi.Content.ToString());
            string saveName = save.Uid.ToString();

            if (saveName == null || "".Equals(saveName))
            {
                return;
            }
            if (saveDevice.Children != null)
            {
                saveDevice.Children.Clear();
            }
            if (saveName.Equals("Alarm"))
            {
                Alarm alarm = RoomManagerBean.Alarm;
                saveDevice.Children.Add(alarm);
                alarm.SetValue(Grid.RowProperty, 0);
                alarm.SetValue(Grid.ColumnProperty, 0);
            }
            else if (saveName.Equals("History"))
            {
                HistoryAlarm alarm = RoomManagerBean.HistoryAlarm;
                saveDevice.Children.Add(alarm);
                alarm.SetValue(Grid.RowProperty, 0);
                alarm.SetValue(Grid.ColumnProperty, 0);
            }
        }
示例#2
0
        private void Alarm_History(object sender, RoutedEventArgs e)
        {
            if (saveDevice.Children != null)
            {
                saveDevice.Children.Clear();
            }
            HistoryAlarm alarm            = RoomManagerBean.HistoryAlarm;
            RoomClass    _Rclass          = new RoomClass();
            DataSet      _HistoryAlarmSet = _Rclass.queryHistoryAlarmList();

            alarm.page.ShowPages(alarm.alarmGrid, _HistoryAlarmSet, BaseRequest.PAGE_SIZE);
            saveDevice.Children.Add(alarm);
            alarm.SetValue(Grid.RowProperty, 0);
            alarm.SetValue(Grid.ColumnProperty, 0);
        }