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 ValuesController(ICalculatorService calculatorService, Scoped scoped, Transient transient, Singelton singelton, LifeStyleService lifeStyleService) { _calculatorService = calculatorService; _scoped = scoped; _transient = transient; _singelton = singelton; _lifeStyleService = lifeStyleService; }
public void DAdd() { Singelton.GetInstance().HostDinners.Add(new HostDinner(Headline, Description, AdditionalNote, Host, Price, DateTime.Today)); OnPropertyChanged(); Headline = ""; Description = ""; AdditionalNote = ""; Host = ""; Price = 0; }
void Awake() { if (S == null) { S = this; DontDestroyOnLoad(this); } else { Destroy(this.gameObject); } }
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); } } }
public Vehicle Remove(string regNum) { int theSpot = Search(regNum); if (theSpot >= 0) { Vehicle v = rutor[theSpot].RemoveVehicle(regNum); DateTime dt = v.ParkedDateTime; string type = v.VehicleType; Factory factory = new Factory(); Singelton S = Singelton.Instance; factory.getCost(dt, type); Menu.PrintGreen($"Cost for {v.VehicleType} {v.RegNum}: {S.Return_Cost.CalculateCost()}"); return(v); } else { Menu.PrintError($"{regNum} is not parked"); } return(null); }
// 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(); }
void Awake() { _instance = this; }
public LifeStyleService(Singelton singelton, Scoped scoped, Transient transient) { _singelton = singelton; _scoped = scoped; _transient = transient; }