Пример #1
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            bool acceptData = true;

            lblInfo.Visible = false;
            if (txtUserName.Text == "")
            {
                lblUserError.Visible = true;
                acceptData           = false;
            }
            if (txtPassword.Text == "")
            {
                lblPassError.Visible = true;
                acceptData           = false;
            }
            if (acceptData == false)
            {
                return;
            }
            LoginArgs arg = new LoginArgs();

            arg.username = txtUserName.Text;
            arg.pass     = txtPassword.Text;
            OnLogin(sender, arg);
        }
Пример #2
0
 public void OnLogin(object sender, LoginArgs e)
 {
     if (bqInet.CbqInet.RequestPOSTPhpDBRead(e.username, e.pass))
     {
         _view.UpdateStatus("OK");
     }
     else
     {
         _view.UpdateStatus("FAIL");
     }
 }
Пример #3
0
 public void OnRegister(object sender, LoginArgs e)
 {
     if (bqInet.CbqInet.RequestPOSTPhpDBWrite(e.username, e.pass, e.email, e.phone))
     {
         _view.UpdateStatus("OK");
     }
     else
     {
         _view.UpdateStatus("FAIL");
     }
 }
Пример #4
0
        private void btnRegister_Click(object sender, EventArgs e)
        {
            bool acceptData = true;

            if (txtUserName.Text == "")
            {
                lblUserError.Visible = true;
                acceptData           = false;
            }
            if (txtPassword.Text == "")
            {
                lblPassError.Visible = true;
                acceptData           = false;
            }
            if (txtPhone.Text == "")
            {
                lblPhoneError.Visible = true;
                acceptData            = false;
            }
            if (IsValidEmail(txtEmail.Text) == false)
            {
                lblEmailError.Visible = true;
                acceptData            = false;
            }
            if (IsPhoneNumber(txtPhone.Text) == false)
            {
                lblPhoneError.Visible = true;
                acceptData            = false;
            }
            if (acceptData == false)
            {
                return;
            }
            LoginArgs arg = new LoginArgs();

            arg.username = txtUserName.Text;
            arg.pass     = txtPassword.Text;
            arg.email    = txtEmail.Text;
            arg.phone    = txtPhone.Text;
            OnRegister(sender, arg);
        }