Exemplo n.º 1
0
    public void Cancel()
    {
        IsCancelledOrArchived();
        IsNotScheduled();

        foreach (var bookedSlot in _slots.GetBookedSlots())
        {
            Raise(new SlotBookingCancelled(Id, bookedSlot.Id, null));
        }

        var events = _slots
                     .All()
                     .Select(slot => new SlotScheduleCancelled(Id, slot.Id))
                     .ToList();

        events.ForEach(Raise);

        Raise(new DayScheduleCancelled(Id));
    }
Exemplo n.º 2
0
 public void ToggleSlotSelection(int slotUid)
 {
     foreach (Slot s in Slots)
     {
         if (s.UID != slotUid)
         {
             continue;
         }
         s.IsSelected = !s.IsSelected;
     }
     IsAllSlotsSelected = Slots.All(x => x.IsSelected);
     SlotSelectionChanged?.Invoke(this, null);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Check if grid is full
 /// </summary>
 private void CheckIsFull()
 {
     IsFull.Value = Slots.All(s => !s.IsFree);
 }
 public bool ValidateSlots()
 {
     return(SlotCapacity == Slots.Count && Slots.All(x => x.Products.Count > 0));
 }