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

60 lines
1.8 KiB

using SchedulingSystemClient.UpdateWindow;
using System.Linq;
using System.Windows;
namespace SchedulingSystemClient
{
/// <summary>
/// LoginWindow.xaml 的交互逻辑
/// </summary>
public partial class LoginWindow : Window
{
public LoginWindow()
{
InitializeComponent();
}
private void but_gb_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
SurgerySchedulingEntities myModel = new SurgerySchedulingEntities();
private void btn_dl_Click(object sender, RoutedEventArgs e)
{
//gh.Text = "admin";
//mm.Password = "123";
if (gh.Text == null || gh.Text == string.Empty)
{
MessageBox.Show("请输入工号");
return;
}
if (mm.Password == null || mm.Password == string.Empty)
{
MessageBox.Show("请输入密码");
return;
}
var listyh = (from tbyh in myModel.SYS_YHB
where tbyh.GH == gh.Text && mm.Password == tbyh.MM
select new
{ tbyh }).ToList();
if (listyh.Count > 0)
{
SYS_YHB user = new SYS_YHB();
user = listyh[0].tbyh;
MainWindow window = new MainWindow(user);
window.Show();
this.Close();
}
else
{
MessageBox.Show("工号或密码错误");
return;
}
}
private void btn_xgmm_Click(object sender, RoutedEventArgs e)
{
XGMMWindow window = new XGMMWindow();
window.ShowDialog();
}
}
}