示例#1
0
       //Querie om een user te registreren
        public void Registreren(Account account, string password)
        {
            using (OracleConnection conn = GetConnection())
            {
                try
                {
                        string query = "INSERT INTO \"ACCOUNT\"(accountid, username,pasword,gender,firstname,surname) VALUES ("+ Getmaxuser() + ", '" + account.Username +"', '"+  account.Password +"', '"+  account.Gender +"', '"+  account.Firstname + "', '"+  account.Lastname + "')";
                        conn.Open();

                        using (OracleCommand cmd = new OracleCommand(query, conn))
                        {
                            cmd.ExecuteNonQuery();
                        }
                    }
                
                catch(OracleException ex)
                {
                    Debug.WriteLine(ex.Message);
                }
                finally
                {
                    conn.Close();
                }
            }
        }
示例#2
0
 public void TestAccount()
 {
     Account account = new Account("Soufyan", "wachtwoord");
    Assert.AreEqual("Soufyan", account.Username, "Check if username is equal");
     Assert.AreEqual("wachtwoord",account.Password, "Check if password is equal");
 }