private void generate_new_arrival() { try { time_to_arrive_people = DateTime.Now.AddSeconds(Comunes.get_random(1, 10)); } catch (Exception exp) { } }
private void pass_customer() { try { Customers customer_group = null; do { if (restaurant.customers.Count > 0) { restaurant.customers.TryPeek(out customer_group); if (restaurant.check_chairs(customer_group.Amount_Of_People, false)) { int id_table = restaurant.check_free_tables(customer_group.Amount_Of_People); if (id_table > 0) { customer_group.Departure_Time = DateTime.Now.AddSeconds(Comunes.get_random(30, 90)); customer_group.Id_Table = id_table; show_host_message("Host: Please, wait number: " + customer_group.Id_Wait_Ticket + " pass to table " + id_table + " "); restaurant.convert_customer_to_diner(); show_remove_persons(); } else { show_host_new_message("Host: Sorry, for the moment we don't have a empty table. Please wait. "); } } else { restaurant.remove_customer(); show_remove_persons(); show_host_message("Host: Apologize, we do not have table with enough space. Next group please."); } } }while (restaurant.customers.Count > 0 && restaurant.check_chairs(customer_group.Amount_Of_People, true)); } catch (Exception exp) { } }