Exemplo n.º 1
0
        private void login_button_Click(object sender, RoutedEventArgs e)        //显示个人页面
        {
            //验证用户名是否存在
            DataTable dt = Tools.getDataTable("select * from passenger where passenger_id=\"" + userId_text.Text + "\"", 0);

            if (dt == null || dt.Rows.Count == 0)
            {
                Tools.messageBox("账号错误,请重新输入");
                userId_text.Text       = "";
                password_text.Password = "";
                return;
            }
            else
            {
                //验证密码是否正确
                String pwd = dt.Rows[0][1].ToString();                //获取数据库中的密码
                if (password_text.Password.Equals(pwd) == false)
                {
                    Tools.messageBox("密码错误,请重新输入");
                    userId_text.Text       = "";
                    password_text.Password = "";
                    return;
                }
            }
            //传递用户名和密码
            CommonData.user_id       = userId_text.Text;
            CommonData.user_password = password_text.Password;
            //status_text.Text = "[debug]用户名:"+userId_text.Text +" 密码:"+ password_text.Password;
            pw = new PersonWindow(); //创建一个新的窗口
            pw.Show();               //显示窗口
        }
Exemplo n.º 2
0
 private void login_button_Click(object sender, RoutedEventArgs e) //显示个人页面
 {
     CommonData.user_id       = userId_text.Text;                  //传递用户名和密码
     CommonData.user_password = password_text.Password;
     status_text.Text         = "[debug]用户名:" + userId_text.Text + " 密码:" + password_text.Password;
     pw = new PersonWindow(); //创建一个新的窗口
     pw.Show();               //显示窗口
 }