Example #1
0
 private async void QueryBtn_Click(object sender, RoutedEventArgs e)
 {
     if (QuerySno.Text != "")
     {
         var datalist = conn.Query <Student>("select *from Student where Sno = ?", QuerySno.Text);
         if (datalist.Count != 0)
         {
             StuViewModel.StudentDatas.Clear();
             foreach (var item in datalist)
             {
                 StuViewModel.StudentDatas.Add(new StudentData()
                 {
                     Sname = "姓名:" + item.Sname, Sno = "学号:" + item.Sno, Sex = "性别:" + item.Sex, Age = "年龄:" + item.Age.ToString(), Password = "******" + item.Password
                 });
             }
             QueryDialog.Hide();
             PopupNotice popupNotice = new PopupNotice("查找成功");
             popupNotice.ShowAPopup();
         }
         else
         {
             MessageDialog AboutDialog = new MessageDialog("该学生不存在!", "提示");
             await AboutDialog.ShowAsync();
         }
     }
     else
     {
         MessageDialog AboutDialog = new MessageDialog("请输入待查询学生的学号!", "提示");
         await AboutDialog.ShowAsync();
     }
 }
Example #2
0
 private void CloseBtn2_Click_1(object sender, RoutedEventArgs e)
 {
     QueryDialog.Hide();
 }