【WPF小白成长记】(二)登录

private void CheckUser(object sender, RoutedEventArgs e)
{
mainDal check = new mainDal();
if (teacher.IsChecked.Equals(true))
{

            if (check.Login(this.username.Text, this.password.Text, "teacher"))
            {
                adminBoard a = new adminBoard();
                name = this.username.Text;
                a.Name1 = name;
                a.Show();
                stdEnd.Begin();
            }
            else
                MessageBox.Show("Invalid Password");
        }
        else if (student.IsChecked.Equals(true))
        {
            if (check.Login(this.username.Text, this.password.Text, "student"))
            {
                studentBoard s = new studentBoard();
                s.Name1 = this.username.Text;
                s.Show();
                stdEnd.Begin();
            }
            else
                MessageBox.Show("Invalid Password");
        }
    }

猜你喜欢

转载自blog.csdn.net/qq_40375549/article/details/89096684
今日推荐