Inheritance: BaseModel, IDataErrorInfo
        /// <summary>
        /// Constructor
        /// </summary>
        public EventViewModel()
        {
            this.Venues = DBLayer.DomainModels.VenueModel.getAll();
            this.Event = new EventModel();

            this._subEventCollection = new ObservableCollection<SubEventModel>();
            this._budgetCollection = new ObservableCollection<BudgetItemModel>();

            this._subEventsToDeleteList = new ObservableCollection<SubEventModel>();
            this._budgetItemToDeleteList = new ObservableCollection<BudgetItemModel>();

            this._curBudgetItem = new BudgetItemModel();

            this._warningMessages = new Dictionary<string, string>();

            if (SessionModel.GetInstance().EditEventID > 0)
            {
                // Load Event from DB Model
                this.Event = new EventModel(DBLayer.DomainModels.EventModel.getByID(SessionModel.GetInstance().EditEventID));

                List<DBLayer.BudgetItem> bList = DBLayer.DomainModels.BudgetItemModel.getByBudgetId(this.Event.Budget.Id);
                foreach (DBLayer.BudgetItem b in bList)
                    this._budgetCollection.Add(new BudgetItemModel(b));

                List<DBLayer.SubEvent> sList = DBLayer.DomainModels.SubEventModel.getAllByEventID(this.Event.Id);
                foreach (DBLayer.SubEvent s in sList)
                    this._subEventCollection.Add(new SubEventModel(s));

                this.IsNewEvent = false;

                // Set default warning messages.
                if (this.Event.IsBudgetOverflow)
                    this.AddWarningMessage("BudgetOverflow", "Oops! Looks like you have busted your budget! Remove some items or increase your budget.");
                if (!this.IsNotCloseToEventDate)
                    this.AddWarningMessage("CloseToEventDate", "You cannot change certain information (capacity, programme) when your event's start date is less than 3 days from now.");
                if (this.Event.IsRegistrationFull)
                    this.AddWarningMessage("RegistrationFull", "Guest registration is full. Unless you increase the event's capacity, no new registrations are allowed.");
            }
            else
            {
                // Add new SubEvent since there must be at least one SubEvent.
                this.AddNewSubEvent();
            }
        }
 /// <summary>
 /// Sets the active BudgetItem to be edited in the form.
 /// </summary>
 /// <param name="b">BudgetItemModel object to be edited.</param>
 public void SetActiveBudgetItem(BudgetItemModel b)
 {
     this.CurBudgetItem = b;
     this.IsBudgetItemEditingMode = true;
 }
        /// <summary>
        /// Deletes the BudgetItem.
        /// </summary>
        /// <param name="b">BudgetItemModel object to be deleted.</param>
        public void DeleteBudgetItem(BudgetItemModel b)
        {
            // BudgetItem exists in the database. Remember to delete it later!
            if (b.Id > 0) this._budgetItemToDeleteList.Add(b);

            this._budgetCollection.Remove(b);
            this.UpdateBudgetUI();
        }