Esempio n. 1
0
 private void System_set(object sender, RoutedPropertyChangedEventArgs<object> e)
 {
     TreeViewItem power = ((sender as TreeView).SelectedItem as TreeViewItem);
     string systemTypeName = power.Uid.ToString();
     if (systemTypeName == null || "".Equals(systemTypeName)) return;
     if (systemGrid.Children != null) systemGrid.Children.Clear();
     if (systemTypeName.Equals("sys"))
     {
         SystemSetting devicePower = SystemManagerFactory.SystemSetting;
         systemGrid.Children.Add(devicePower);
         devicePower.SetValue(Grid.RowProperty, 0);
         devicePower.SetValue(Grid.ColumnProperty, 0);
     }
     else if (systemTypeName.Equals("setting"))
     {
         AlarmSetting alarmSetting = SystemManagerFactory.AlarmSetting;
         systemGrid.Children.Add(alarmSetting);
         alarmSetting.SetValue(Grid.RowProperty, 0);
         alarmSetting.SetValue(Grid.ColumnProperty, 0);
     }
     else if (systemTypeName.Equals("userLog"))
     {
         AllUserLog userLog = SystemManagerFactory.UserLog;
         Users user = new Users();
         DataSet set = user.getUserLoginLog();
         userLog.page.ShowPages(userLog.logGrid, set, BaseRequest.PAGE_SIZE);
         systemGrid.Children.Add(userLog);
         userLog.SetValue(Grid.RowProperty, 0);
         userLog.SetValue(Grid.ColumnProperty, 0);
     }
     else if (systemTypeName.Equals("movedLog"))
     {
         MovedDevicesLog movedDevicesLog = SystemManagerFactory.MovedDevicesLog;
         SystemManager sm = new SystemManager();
         DataSet set=sm.getEquipmentOperation();
         movedDevicesLog.page.ShowPages(movedDevicesLog.EquiplogGrid, set, BaseRequest.PAGE_SIZE);
         systemGrid.Children.Add(movedDevicesLog);
         movedDevicesLog.SetValue(Grid.RowProperty, 0);
         movedDevicesLog.SetValue(Grid.ColumnProperty, 0);
     }
     else if (systemTypeName.Equals("cycleSetting"))
     {
         BackupCycleSetting backupCycleSetting = new BackupCycleSetting();
         systemGrid.Children.Add(backupCycleSetting);
         backupCycleSetting.SetValue(Grid.RowProperty, 0);
         backupCycleSetting.SetValue(Grid.ColumnProperty, 0);
     }
 }