/// <summary> /// Deletes the specified SubEvent from the list. /// </summary> /// <param name="s">SubEventModel object to be delted.</param> public void DeleteSubEvent(SubEventModel s) { // SubEvent exists in the database. Remember to delete it later! if (s.Id > 0) this._subEventsToDeleteList.Add(s); this._subEventCollection.Remove(s); this.NotifyPropertyChanged("SubEventCollection"); // If list is empty, add a new one since there must be at least one SubEvent. if (this._subEventCollection.Count <= 0) this.AddNewSubEvent(); }
/// <summary> /// Adds an empty SubEvent into the list. /// </summary> public void AddNewSubEvent() { SubEventModel s = new SubEventModel(new DBLayer.SubEvent()); s.Name = ""; s.Start = new DateTime( DateTime.Now.Year, DateTime.Now.Month, (DateTime.Now.Day + 3), 8, 0, 0); s.End = new DateTime(DateTime.Now.Year, DateTime.Now.Month, (DateTime.Now.Day + 3), 9, 0, 0); this._subEventCollection.Add(s); this.NotifyPropertyChanged("SubEventCollection"); s.VenueId = 1; this.UpdateCapacityUI(); }