public CreatePartyPage(InUserSingleton userSingleton) { _userSingleton = userSingleton; user = userSingleton.getUser(); parties = userSingleton.getParties(); activeParty = userSingleton.getActiveParty(); }
/// <summary> /// Sets the active party, based which one the user chose. /// </summary> /// <param name="partyTitle"></param> /// <returns>Page depending on whether the user is a host for the party or not</returns> public RedirectToPageResult OnGetSetActiveParty(string partyTitle) { Console.WriteLine("I am in this method"); foreach (var party in parties) { if (party.partyTitle.Equals(partyTitle)) { activeParty = party.copy(); _userSingleton.setActiveParties(party); _userSingleton.getItemsAdded().Clear(); //more should be cleared Console.WriteLine("I've changed the party"); Console.WriteLine(activeParty.partyTitle); } } if (activeParty.host.name == _userSingleton.getUser().name) { return(RedirectToPage("UserPage")); } else { return(RedirectToPage("UserPartyPage")); } }
public EditPartyPage(InUserSingleton userSingleton) { _userSingleton = userSingleton; user = userSingleton.getUser(); parties = userSingleton.getParties(); activeParty = userSingleton.getActiveParty(); // _userSingleton.setActiveParties(activeParty); }
public HomePage(InUserSingleton userSingleton) { _userSingleton = userSingleton; user = userSingleton.getUser(); parties = userSingleton.getParties(); if (userSingleton.getActiveParty() != null) { activeParty = userSingleton.getActiveParty().copy(); } }
/// <summary> /// Sets the active party, based which one the user chose. /// </summary> /// <param name="partyTitle"></param> /// <returns>Page depending on whether the user is a host for the party or not</returns> public RedirectToPageResult OnGetSetActiveParty(string partyTitle) { foreach (var party in parties) { if (party.partyTitle.Equals(partyTitle)) { activeParty = party.copy(); _userSingleton.setActiveParties(party); _userSingleton.getItemsAdded().Clear(); } } if (activeParty.host.name == _userSingleton.getUser().name) { return(RedirectToPage("UserPage")); } else { return(RedirectToPage("UserPartyPage")); } }
public UserPage(InUserSingleton userSingleton) { _userSingleton = userSingleton; user = userSingleton.getUser(); parties = userSingleton.getParties(); if (userSingleton.getActiveParty() != null) { activeParty = userSingleton.getActiveParty().copy(); } if (_userSingleton.getSearchResult() != null) { SearchedPeople = _userSingleton.getSearchResult(); } }