コード例 #1
0
        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;
        }
コード例 #2
0
        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();
            }

        }
コード例 #3
0
 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();
     }
 }
コード例 #4
0
        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();
                }

            }
        }