Beispiel #1
0
        public void Visit(IItemPrenotation itemPrenotation)
        {
            TreeNode node = new TreeNode();

            node.Text = "Prenotazione dal " + itemPrenotation.RangeData.StartDate.ToShortDateString()
                        + " al " + itemPrenotation.RangeData.EndDate.ToShortDateString() + ", prezzo corrente : " + itemPrenotation.Price;
            _itemPrenotationNodes.Add(itemPrenotation, node);
        }
 public void AddItem(IItemPrenotation item)
 {
     #region Precondizioni
     if (item == null)
     {
         throw new ArgumentNullException("item null");
     }
     if (!CanAdd(item))
     {
         throw new Exception("item prenotation not valid");
     }
     #endregion
     _bookedItems.Add(item);
     item.PrenotationChanged += (sender, ipea) => OnPrenotatitionChangedHandler(this, new PrenotationEventArgs(this));
     OnPrenotatitionChangedHandler(this, new PrenotationEventArgs(this));
 }
Beispiel #3
0
 /// <summary>
 /// CustomPrenotation di default, non aggiunge nessun dettaglio
 /// </summary>
 /// <param name="ip"></param>
 /// <returns>null</returns>
 private TreeNode[] CustomItemPrenotation(IItemPrenotation ip)
 {
     return(null);
 }
Beispiel #4
0
 public ItemPrenotationEventArgs(IItemPrenotation prenotation)
 {
     _prenotation = prenotation;
 }
 private bool CanAdd(IItemPrenotation IItemPrenotation)
 {
     return(PrenotationDate.Contains(IItemPrenotation.RangeData));
 }