Пример #1
0
        private async void btDeconnect_Click(object sender, EventArgs e)
        {
            btConnect.Enabled = false;
            btDeconnect.Enabled = false;

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

       
            if (ret.IsSuccess)
            {
                
                lbError.Text = "Vous n'êtes pas connecté";
            }
            else
            {
                lbError.Text = "Vous n'êtes pas connecté" + ret.ErrorMessage;
            }

            btConnect.Enabled = true;
            btDeconnect.Enabled = true;
           
            lstbPseudos.Items.Clear();
            txtboxWebService.Enabled = true;
            txtboxPseudo.Enabled = true;
            txtboxPassword.Text = String.Empty;
            
        }
Пример #2
0
        private async void btDeconnecter_Click(object sender, EventArgs e)
        {
            btConnect.Enabled   = false;
            btDeconnect.Enabled = false;

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


            if (ret1.IsSuccess)
            {
                lblErreur.Text = "Vous n'êtes pas connecté";
            }
            else
            {
                lblErreur.Text = "Vous n'êtes pas connecté" + ret1.ErrorMessage;
            }

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

            // On ré-initialise les champs de la fenêtre
            lstbPseudos.Items.Clear();
            txtWebService.Enabled = true;
            txtPseudo.Enabled     = true;
            txtPassword.Text      = String.Empty;
            txtPseudo.Text        = String.Empty;
            btConnect.Enabled     = true;
            btDeconnect.Enabled   = false;
        }
Пример #3
0
        private async void btnDeconnect_Click(object sender, EventArgs e)
        {
            await dal.LogoutAsync(CancellationToken.None);

            txtBoxMdp.Clear();
            listBoxUtilisateurs.DataSource = null;
            Grisage();
        }
        public async Task <bool> LogoutAsync(CancellationToken cancel)
        {
            _timer.Stop();

            RdmDalWSRResult ret = await _rdmDAL.LogoutAsync(cancel);

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

            return(ret.IsSuccess);
        }