Beispiel #1
0
        private void btMonEspace_Click(object sender, EventArgs e)
        {
            if (LoginUtilisateur != "" && MotDePasse != "")
            {
                ConfirmationConnection = true;
            }

            if (ConfirmationConnection == true)
            {
                if (rbClient.Checked == true)
                {
                    FormEspaceClient f = new FormEspaceClient();
                    f.ShowDialog();
                }
                else if (rbEmploye.Checked == true)
                {
                    FormEspaceEmploye f = new FormEspaceEmploye();
                    f.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("Veuillez vous connecter !");
                btMonEspace.Visible = false;
            }
            textBoxLogin.Select();
        }
Beispiel #2
0
        private void btValidationConnection_Click(object sender, EventArgs e)  // Connection
        {
            // Cryptage du mot de passe saisie

            /*byte[] bytes = Encoding.UTF8.GetBytes(MotDePasse);
             * byte[] protectedBytes = ProtectedData.Protect(bytes, null, DataProtectionScope.CurrentUser);
             * MotDePasse = Convert.ToBase64String(protectedBytes);*/

            ConfirmationConnection = sc.Loguer(LoginUtilisateur, MotDePasse);


            if (ConfirmationConnection == true)
            {
                if (rbClient.Checked == true)
                {
                    FormEspaceClient f = new FormEspaceClient();
                    f.ShowDialog();
                }
                else if (rbEmploye.Checked == true)
                {
                    FormEspaceEmploye f = new FormEspaceEmploye();
                    f.ShowDialog();
                }

                btDeconnection.Visible = true;
                btMonEspace.Visible    = true;
                textBoxLogin.Select();
            }
            else
            {
                MessageBox.Show("La connection a échouée ! \n     Veuillez entrer votre Login et votre Mot de passe.");
                textBoxLogin.Select();
            }
        }