示例#1
0
        private async void LoginBtn_Click(object sender, RoutedEventArgs e)
        {
            if (txbUser.Text != "" &&
                pwbPassword.Password.ToString() != "")
            {
                LoginResult user = await Controller.Instance.Login(txbUser.Text, pwbPassword.Password.ToString());

                if (user.Result)
                {
                    //Chia ra là Giáo Viên, Học Sinh
                    mwd.CheckTypeAccount("Giáo Viên");
                    mwd.Show();
                    this.Close();
                }
                else
                {
                    iNotifierBox.Text = "Sai tên đăng nhập hoặc mật khẩu";
                    iNotifierBox.ShowDialog();
                }
            }
            else
            {
                iNotifierBox.Text = "Vui lòng điền đầy đủ thông tin";
                iNotifierBox.ShowDialog();
            }
        }
示例#2
0
        private async void LoginBtn_Click(object sender, RoutedEventArgs e)
        {
            string      username = txbUser.Text;
            string      password = pwbPassword.Password.ToString();
            LoginResult user     = await Controller.Instance.Login(username, password);

            if (user.Result)
            {
                MenuWindow mwd = new MenuWindow();
                mwd.Show();
                this.Close();
            }
            else
            {
                iNotifierBox.Text = "Lỗi";
                iNotifierBox.ShowDialog();
            }
        }