private void button1_Click(object sender, RoutedEventArgs e) { textBlock1.Text = ""; OracleConnection oc = CommonMethods.GetConnection(); oc.Open(); OracleCommand ocmd = oc.CreateCommand(); ocmd.CommandText = String.Format("select PERSOON_ID, NAAM, ACHTERNAAM, EMAIL, WACHTWOORD, TELEFOON, POSTCODE, NATIONALITEIT, WOONPLAATS, ADRES from persoon where email = '{0}' AND wachtwoord = '{1}'", textBox1.Text, passwordBox1.Password); OracleDataReader odr = ocmd.ExecuteReader(); if (odr.HasRows) { while (odr.Read()) { Customer cust = new Customer(Decimal.ToInt32((decimal)odr[0]), (string)odr[1], (string)odr[2], (string)odr[3], (string)odr[4], (string)odr[5], (string)odr[6], (string)odr[7], (string)odr[8], (string)odr[9]); CommonMethods.loginUser = cust; } NavigationWindow nw = new NavigationWindow(); nw.ShowsNavigationUI = false; nw.Navigate(new HomePage()); nw.Show(); CommonMethods.GetWindow(this).Close(); } else { textBlock1.Text = "Oops!\nGeen gebruiker gevonden met deze gegevens."; } oc.Close(); }
public static void Main() { var customers = new List<Customer>(); for (int i = 0; i < 10; i++) { var c = new Customer { Id = i, Name = "Customer " + i }; customers.Add(c); } var table = PrintTable(customers); PrintCollection(table); Console.ReadLine(); }