You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.7 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using XGL.Data;
namespace XGL.Views
{
/// <summary>
/// CheckUserWin.xaml 的交互逻辑
/// </summary>
public partial class CheckUserWin : Window
{
private UserLogin ul;
public bool loginFlag;
public CheckUserWin()
{
InitializeComponent();
}
private void btnCancel_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
private void btnOK_Click(object sender, RoutedEventArgs e)
{
userDB usdb = new userDB();
bool islogin = usdb.Login(txtUserID.Text.Trim(), pw.Password.Trim());
if (islogin)
{
loginFlag = islogin;
tbMsg.Content = "校验成功";
this.Close();
}
else
{
loginFlag = islogin;
tbMsg.Content = "校验失败";
}
}
private void txtUserID_TextChanged(object sender, TextChangedEventArgs e)
{
this.tbMsg.Content = "";
}
private void pw_PasswordChanged(object sender, RoutedEventArgs e)
{
tbMsg.Content = "";
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
txtUserID.Text = "admin";
pw.Password = "admin123";
}
}
}