Beispiel #1
0
 private void buttonLogin_Click(object sender, EventArgs e)
 {
     if (textBoxUsername.Text.Equals("") || textBoxPassword.Text.Equals(""))
     {
         MessageBox.Show("用户名或密码为空");
         return;
     }
     try
     {
         SupplierInfo.supplier = SupplierDataAccess.LoginSupplier(textBoxUsername.Text, textBoxPassword.Text);
         MainForm mainForm = MainForm.CreateForm();
         Hide();
         mainForm.ShowDialog();
         Show();
     }
     catch
     {
         MessageBox.Show("登录失败");
     }
 }