//警报处理 private void Treatment_Click(object sender, RoutedEventArgs e) { var a = this.alarmGrid.SelectedItem; var b = a as DataRowView; int _Aid = Convert.ToInt32(b.Row[0]); RoomClass rc = new RoomClass(); MySqlDataReader reader = rc.getAlarmInformation(_Aid); TreatmentAlarm ta = new TreatmentAlarm(); if(reader.Read()) { ta.Aid.Text = reader["ALARM_ID"].ToString(); ta.number.Text = reader["NUMBER"].ToString(); ta.Etype.Text = reader["TYPE_NAME"].ToString(); ta.Atype.Text = reader["ALARM_TYPE_NAME"].ToString(); ta.Room.Text = reader["ROOM_NAME"].ToString(); ta.Time.Text = reader["ALARM_TIME"].ToString(); } ta.Owner = Window.GetWindow(this); ta.ShowDialog(); }
//警报处理 private void Treatment_Click(object sender, RoutedEventArgs e) { var a = this.alarmGrid.SelectedItem; var b = a as DataRowView; int _Aid = Convert.ToInt32(b.Row[0]); RoomClass rc = new RoomClass(); MySqlDataReader reader = rc.getAlarmInformation(_Aid); TreatmentAlarm ta = new TreatmentAlarm(); if (reader.Read()) { ta.Aid.Text = reader["ALARM_ID"].ToString(); ta.number.Text = reader["NUMBER"].ToString(); ta.Etype.Text = reader["TYPE_NAME"].ToString(); ta.Atype.Text = reader["ALARM_TYPE_NAME"].ToString(); ta.Room.Text = reader["ROOM_NAME"].ToString(); ta.Time.Text = reader["ALARM_TIME"].ToString(); } ta.Owner = Window.GetWindow(this); ta.ShowDialog(); }