public void GenererChaineConnexion(string laChaine)
        {
            string _Licence;

            _Licence = Cryptage.Encrypt(laChaine);
            AuthentInitializeServiceClient client = new AuthentInitializeServiceClient();

            client.GenereLicenceCompleted += (ss, res) =>
            {
                if (res.Cancelled || res.Error != null)
                {
                    string error = res.Error.Message;
                    return;
                }

                if (res.Result == null)
                {
                    return;
                }
            };
            client.GenereLicenceAsync(_Licence);
        }
        public void  GenererLicence(string Datedebut, string NbreJour)
        {
            string _Licence;

            _Licence = Cryptage.Encrypt(Datedebut + "," + NbreJour);
            AuthentInitializeServiceClient client = new AuthentInitializeServiceClient();

            client.GenereLicenceCompleted += (ss, res) =>
            {
                if (res.Cancelled || res.Error != null)
                {
                    string error = res.Error.Message;
                    return;
                }

                if (res.Result == null)
                {
                    return;
                }
            };
            client.GenereLicenceAsync(_Licence);
        }
Esempio n. 3
0
 private void btInscrire_Click(object sender, EventArgs e)
 {
     try
     {
         AdminController ac = new AdminController();
         if (txtPassword.Text.ToString().Equals(txtConfirmPassword.Text.ToString()))
         {
             Cryptage c = new Cryptage();
             ac.Inscrire(int.Parse(txtMatricule.Text.ToString()), txtLogin.Text.ToString(), c.Encrypt(txtPassword.Text.ToString()));
             this.Close();
         }
         else
         {
             MessageBox.Show("Vérifier le mot de passe", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error :" + ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }