public Tafelbezet[] TafelsBezet() { Tafelbezet[] tafelbezet = new Tafelbezet[10]; OleDbConnection conn = new OleDbConnection(connString); conn.Open(); OleDbCommand command = new OleDbCommand("SELECT Tafel FROM Bestelling WHERE Status='Bezet';", conn); OleDbDataReader reader = command.ExecuteReader(); while (reader.Read()) { int i = Convert.ToInt32(reader.GetString(0)) - 1; tafelbezet[i].bezet = true; } conn.Close(); return(tafelbezet); }
private void setButtonColor(Button button, int klaarCount, Tafelbezet[] klaar) { button.BackColor = klaar[klaarCount].bezet ? Color.IndianRed : Color.DarkKhaki; }
public Tafelbezet[] TafelsRes() { Tafelbezet[] tafelbezet = new Tafelbezet[10]; OleDbConnection conn = new OleDbConnection (connString); conn.Open (); OleDbCommand command = new OleDbCommand ("SELECT Tafel FROM Bestelling WHERE Status='Gereserveerd';", conn); OleDbDataReader reader = command.ExecuteReader (); while (reader.Read ()) { int i = Convert.ToInt32 (reader.GetString (0)) - 1; tafelbezet[i].bezet = true; } conn.Close (); return tafelbezet; }