Пример #1
0
 private void HistoryOrder_Click(object sender, RoutedEventArgs e)
 {
     SystemManager sm = new SystemManager();
     var a = this.EquiplogGrid.SelectedItem;
     var b = a as DataRowView;
     int _LogId = Convert.ToInt32(b.Row[0]);
     OperationEquipmentInfo opi = new OperationEquipmentInfo();
     MySqlDataReader reader = sm.getEquipmentInfo(_LogId);
     if (reader.HasRows)
     {
         if (reader.Read())
         {
             opi.number.Text = reader["NUMBER"].ToString();
             opi.Ename.Text = reader["NAME"].ToString();
             opi.Etype.Text = reader["TYPE_NAME"].ToString();
             opi.room.Text = reader["ROOM_NAME"].ToString();
             opi.Otype.Text = OperationTypeString.getTypeStr(int.Parse(reader["TYPE"].ToString()));
             opi.Ouser.Text = reader["ACCOUNT"].ToString();
             opi.Etime.Text = Convert.ToDateTime(reader["STORAGE_TIME"]).ToString(BaseRequest.DATE_MS_FORMAT);
             opi.Otime.Text = Convert.ToDateTime(reader["DATE_TIME"]).ToString(BaseRequest.DATE_MS_FORMAT);
         }
         opi.Owner = Window.GetWindow(this);
         opi.ShowDialog();
     }
 }
Пример #2
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);
     }
 }