private async void QueryBtn3_Click(object sender, RoutedEventArgs e) { if (QueryCno.Text != "") { var datalist = conn.Query <Course>("select *from Course where Cno = ?", QueryCno.Text); if (datalist.Count != 0) { CouViewModel.CourseDatas.Clear(); foreach (var item in datalist) { CouViewModel.CourseDatas.Add(new CourseData() { Cname = "课程名:" + item.Cname, Cno = "课程号:" + item.Cno, Tno = "任课老师工号:" + item.Tno, Credit = "学分:" + item.Credit }); } QueryDialog3.Hide(); PopupNotice popupNotice = new PopupNotice("查找成功"); popupNotice.ShowAPopup(); } else { MessageDialog AboutDialog = new MessageDialog("该课程不存在!", "提示"); await AboutDialog.ShowAsync(); } } else { MessageDialog AboutDialog = new MessageDialog("请输入待查询课程的课程号!", "提示"); await AboutDialog.ShowAsync(); } }
private void CCloseBtn2_Click(object sender, RoutedEventArgs e) { QueryDialog3.Hide(); }
private async void QueryCourse_Click(object sender, RoutedEventArgs e) { await QueryDialog3.ShowAsync(); }