示例#1
0
        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            JSONResultFormat1 js     = new JSONResultFormat1();
            AsyncWorker       worker = new AsyncWorker(this);

            if (tbPhoneNumber.Text.Length == 11 && pbPwd.Password.Length == 6)
            {
                if (true == worker.InvokeCheckVerifyCode(VOP.MainWindow.m_RequestManager.CheckVerifyCode, tbPhoneNumber.Text, pbPwd.Password, ref js))
                {
                    m_strPhoneNumber = tbPhoneNumber.Text;
                    VOP.MainWindow.SaveUserInfoIntoXamlFile(tbPhoneNumber.Text, pbPwd.Password);
                    this.DialogResult = true;
                    this.Close();
                }
                else
                {
                    pbPwd.Focus();
                    pbPwd.SelectAll();
                    tbkErrorInfo.Text = (string)this.FindResource("ResStr_Invalid_verification_code_Please_check_and_enter_again");
                }
            }
            else
            {
                if (tbPhoneNumber.Text.Length != 11)
                {
                    tbkErrorInfo.Text = (string)this.FindResource("ResStr_Msg_7");
                    tbPhoneNumber.Focus();
                }
                else if (pbPwd.Password.Length != 6)
                {
                    tbkErrorInfo.Text = (string)this.FindResource("ResStr_Invalid_verification_code_Please_check_and_enter_again");
                    pbPwd.Focus();
                    pbPwd.SelectAll();
                }
            }
        }