/// <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")); } }
/// <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")); } }