private void Window_Loaded_1(object sender, RoutedEventArgs e) { if (rent == null) { return; } TBinfo.Text = rent.Info; if (!rent.Approved) { TBinfo.Text += " (未审核)"; } TBinfo.Background = new SolidColorBrush(MyColor.NameColor(rent.Info, 0.2)); TBinfo.Foreground = new SolidColorBrush(WindowIndex.textColor); TBhost.Content = "申请人: " + DatabaseLinker.GetName(rent.pId); Classroom c = Building.GetClassroom(rent.cId); if (c != null) { TBclassroom.Content = "教室: " + c.Name; } else { TBclassroom.Visibility = Visibility.Collapsed; TBclassroom_Copy.Visibility = Visibility.Collapsed; } TBrentTime.Content = "时间: " + rent.Time.Display(); List <int> listPId = DatabaseLinker.GetPIdList(rent.rId); TBtakepartinInfo.Content = "参加人数: " + listPId.Count; if (rent.Time.BeenOver) { TBChoose.Content = "课程已结束"; } else if (father.personRentTable.Contains(rent.rId)) { TBChoose.Content = "从我的课程表删除"; } else { TBChoose.Content = "加入我的课程表"; } if (rent.Approved || father.Peron is User) { TBOK.Visibility = Visibility.Collapsed; TBDecline.Visibility = Visibility.Collapsed; } }
private void TBtakepartinInfo_MouseDown(object sender, MouseButtonEventArgs e) { string s = ""; List <int> listPId = DatabaseLinker.GetPIdList(rent.rId); foreach (int pId in listPId) { s += DatabaseLinker.GetName(pId) + " "; } if (listPId.Count == 0) { s = "暂时没有人参加。"; } MessageBox.Show(s, "参加同学名单"); }