コード例 #1
0
        public async Task <bool> LoginAsync(CancellationToken cancel)
        {
            RdmDalWSRResult ret = await _rdmDAL.LoginAsync(cancel);

            IsLogged     = _rdmDAL.IsLogged;
            ErrorMessage = ret.ErrorMessage;

            return(ret.IsSuccess);
        }
コード例 #2
0
        private async void btnLoginAsync_Click(object sender, EventArgs e)
        {
            btnLoginAsync.Enabled = false;
            dal = new RdmDalWSR("http://user09.2isa.org/", txtBoxPseudo.Text);
            RdmDalWSRResult ret = await dal.LoginAsync(CancellationToken.None);

            if (ret.ErrorCode == 0)
            {
                txtBoxMdp.Text = dal.Password;
                Grisage();
                GetListUsers();
            }
            else
            {
                MessageBox.Show(ret.ErrorMessage);
            }
        }
コード例 #3
0
        private async void btConnect_Click(object sender, EventArgs e)
        {
            btConnect.Enabled = false;
            btDeconnect.Enabled = false;

            RdmDalWSRResult ret = await _rdmDal.LoginAsync(CancellationToken.None);

            if (ret.IsSuccess)
            {
                txtboxWebService.Enabled = false;
                txtboxPseudo.Enabled = false;
                txtboxPassword.Text = (string) ret.Data;
                lbError.Text = "Vous êtes connecté";
            }
            else
            {
                lbError.Text = ret.ErrorMessage;
            }

            btConnect.Enabled = true;
            btDeconnect.Enabled = true;

        }
コード例 #4
0
        private async void btConnecter_Click(object sender, EventArgs e)
        {
            pnlConnexion.Enabled = false;
            //btConnect.Enabled = true;
            //btDeconnect.Enabled = false;

            //_rdmDal.PseudoConnect = txtPseudo.Text;

            RdmDalWSRResult ret1 = await _rdmDal.LoginAsync(CancellationToken.None);

            if (ret1.IsSuccess)
            {
                txtWebService.Enabled = false;
                txtPseudo.Enabled     = false;
                txtPassword.Text      = (string)ret1.Data;
                lblErreur.Text        = "Vous êtes connecté";
            }
            else
            {
                lblErreur.Text = ret1.ErrorMessage;
            }

            RdmDalWSRResult ret2 = await _rdmDal.GetPseudosAsync(CancellationToken.None);

            if (ret2.IsSuccess && _rdmDal.IsLogged)
            {
                AfficheListePseudos(ret2);
            }
            else
            {
                lblErreur.Text = ret2.ErrorMessage;
            }
            //btConnect.Enabled = false;
            //btDeconnect.Enabled = true;
            pnlConnexion.Enabled = true;
        }