Example #1
0
        private bool verifiyPassword(string passworToCheck, string databasePassword)
        {
            Encrypter passwordEncryption = new Encrypter();

            if (passwordEncryption.encryptPassword(passworToCheck) == databasePassword)
            {
                return(true);
            }
            return(false);
        }
Example #2
0
 private void insertUsernameAndPassword(string username, string password, string angajatID)
 {
     using (SqlConnection connection = new System.Data.SqlClient.SqlConnection(Helper.ConnectionValue("connectionString")))
     {
         connection.Open();
         Encrypter  passwordEncrypter = new Encrypter();
         UserData   userData          = new UserData();
         DataTable  dataTable         = new DataTable();
         SqlCommand sqlCommand        = new SqlCommand("dbo.Angajati_InsertUser @username ='******' ,@password = '******' ,@angajatID =  " + angajatID, connection);
         try
         {
             sqlCommand.ExecuteNonQuery();
         }
         catch (Exception ex)
         {
             MessageBox.Show("Utilizatorul exista deja");
         }
     }
 }