public bool checkIfMaxRes(LaundryUser laundryUser) { int count = 0; foreach (var res in laundryUser.Reservations) { if (!res.reservationUsed.GetValueOrDefault()) { count += res.Machines.Count; } } return(count >= maxReservationPerUser.GetValueOrDefault()); }
public bool checkIfMaxRes(LaundryUser laundryUser) { int count = 0; foreach (var res in laundryUser.Reservations) { if (!res.reservationUsed.GetValueOrDefault()) { count += res.Machines.Count; } } return (count >= maxReservationPerUser.GetValueOrDefault()); }
public void Init() { laundryRoom = new LaundryRoom(); laundryRoom.Machines.Add(new Machine()); laundryRoom.Machines.Add(new Machine()); laundryRoom.Machines.Add(new Machine()); laundryUser = new LaundryUser(); laundryUser.name = "Namjoo"; reservation = new Reservation(); washTime = new WashTime(); washTime.fromTime = DateTime.Now.AddMinutes(10).TimeOfDay; reservation.WashTime1 = washTime; laundryUser.Reservations.Add(reservation); }