public void HAdd() //used to call the add command on the singelton object of household { Singelton.GetInstance().Households.Add(new Household(Address, Email)); OnPropertyChanged(); Address = 0; Email = ""; }
public void DAdd() { Singelton.GetInstance().HostDinners.Add(new HostDinner(Headline, Description, AdditionalNote, Host, Price, DateTime.Today)); OnPropertyChanged(); Headline = ""; Description = ""; AdditionalNote = ""; Host = ""; Price = 0; }
public async void LoadHousehold() { var household = await PersistenceFacade.LoadHouseholdJason(); Singelton.GetInstance().Households.Clear(); if (household != null) { foreach (var house in household) { Singelton.GetInstance().Households.Add(house); } } }
// End day four #endregion // ## No longer in use // # Property to get IsThursday value //public bool ThursdayChecked //{ // get { return days.IsThursday(); } //} #endregion #endregion // # Constructor public ViewModel() { #region Alex [RESERVATION] _reservations = Singelton.GetInstance().Reservations; Singelton.GetInstance().Reservations.Add(new Reservation(0, 0, 0, 0)); #endregion #region Alex [CALCULATOR] _calculation = Singelton.GetInstance().Calculation; Singelton.GetInstance().Calculation.Add(new Calcualtor(0, 0, 0, 0)); #endregion #region jacob _households = Singelton.GetInstance().Households; _hostDinners = Singelton.GetInstance().HostDinners; HAddCommand = new RelayCommand(HAdd); HRemoveCommand = new RelayCommand(HRemove); HSaveCommand = new RelayCommand(SaveHousehold); HLoadCommand = new RelayCommand(LoadHousehold); DAddCommand = new RelayCommand(DAdd); #endregion #region Henrik days = new CommunalEating.Models.Calendar(); day1 = new HostDinner("Kødsovs", "Serveres med yadada", "Kan indeholde kød", "hans", 500, DateTime.Today); day2 = new HostDinner("En anden ret", "Serveres med yadada", "Kan indeholde kød", "hans", 500, DateTime.Today.AddDays(4)); day3 = new HostDinner("En tredje ret", "Serveres med yadada", "Kan indeholde kød", "hans", 500, DateTime.Today.AddDays(5)); day4 = new HostDinner("Og den sidste ret", "Serveres med yadada", "Kan indeholde kød", "hans", 500, DateTime.Today.AddDays(6)); #endregion }
public async void SaveHousehold() { PersistenceFacade.SaveHouseholdJason(Singelton.GetInstance().Households); }
public void HRemove() //Used to call the remove command on the singelton object of household at (housepick) location { Singelton.GetInstance().Households.RemoveAt(HousePick); OnPropertyChanged(); }