public void SortTeamsByClub(Club club) { var tempTeamlist = new ObservableCollection<Team>(); foreach (var team in _sCommon.TeamList) { if (team.Club == club.Id) { tempTeamlist.Add(team); } } TeamList = tempTeamlist; }
public async void CreateClub() { if (Name == null || Name.Equals("")) { MsgDialog = new MessageDialog("Indtast Klubnavn"); MsgDialog.ShowAsync(); } else if (Name != null || Name != "") { Club club = new Club(Name); club.IsActive = true; await WsContext.CreateClub(club); frame.Navigate(typeof(CreateNewPage)); WsContext.LoadClubs(); } }
public void SetClubActivity(Club club) { _club = club; if (_club.IsActive) { MsgDialog = new MessageDialog(_club.Name + " er Aktiv. Vil du markere denne som Inaktiv?"); _currentActivityType = "club"; MsgDialog.Commands.Add(new UICommand("Ja", InactivityClick)); MsgDialog.Commands.Add(new UICommand("Nej")); MsgDialog.ShowAsync(); } else if (!_club.IsActive) { MsgDialog = new MessageDialog(_club.Name + " er Inaktiv. Vil du markere denne som Aktiv?"); _currentActivityType = "club"; MsgDialog.Commands.Add(new UICommand("Ja", ActivityClick)); MsgDialog.Commands.Add(new UICommand("Nej")); MsgDialog.ShowAsync(); } }
public async Task CreateClub(Club club) { handler = new HttpClientHandler(); handler.UseDefaultCredentials = true; using (var client = new HttpClient(handler)) { client.BaseAddress = new Uri(ServerUrl); client.DefaultRequestHeaders.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); try { var response = await client.PostAsJsonAsync("Clubs", club, CancelToken.Token); } catch (Exception ex) { new MessageDialog(ex.Message).ShowAsync(); } } }