public PlayerInTeam( Team team , Player player, int year ) : base() { this.teamId = team.Id; this.playerId = player.Id; this.year = year; }
private void AddPlayer_Click(object sender, RoutedEventArgs e) { if (sampleTeam == null) { sampleTeam = new Team(league, team.Text, manager.Text, phone.Text, email.Text, imageUrl.Text); } addPlayerWindow = new AddPlayer(sampleTeam, playersList, league); bool? res = addPlayerWindow.ShowDialog(); }
public Game( string league , string mainReferee , string secondReferee , string location , DateTime date , Team teamOne , Team teamTwo , string score ) { this.teamOneId = teamOne.Id; this.teamTwoId = teamTwo.Id; this.league = league; this.firstReferee = mainReferee; this.secondReferee = secondReferee; this.location = location; this.date = date; this.score = score; }
public AddPlayer(Team team, ObservableCollection<Player> playersList, string selectedleague) { InitializeComponent(); this.team = team; this.playersList = playersList; if (selectedleague == "Male") { RadioButtonMale.IsChecked = true; RadioButtonMale.IsEnabled = false; RadioButtonFemale.IsEnabled = false; } else { RadioButtonFemale.IsChecked = true; RadioButtonMale.IsEnabled = false; RadioButtonFemale.IsEnabled = false; } }
public ActionResult Index(Guid teamId, string gender) { Team team; Dictionary<string, string> teamDict; List<Dictionary<string, string>> list; List<Player> playersList = new List<Player>(); Middleware.VolleyballService.VolleyballServiceClient client; client = new Middleware.VolleyballService.VolleyballServiceClient(); list = new List<Dictionary<string, string>>(client.ReadPlayers_Team(teamId)); teamDict = client.Read(teamId, Middleware.VolleyballService.TablesNames.Teams); team = new Team(teamDict); foreach (var item in list) { playersList.Add(new Player(item)); } if (!string.IsNullOrEmpty(gender)) { ViewBag.gender = gender; } return View(new TeamInformationModel(playersList, team)); }
private void team2Name_SelectionChanged( object sender , SelectionChangedEventArgs e ) { var index = ( sender as ComboBox ).SelectedIndex; teamTwo = new Team( TeamsList[ index ] ); PlayersTeamTwo = teamTwo.Players; TeamTwoName.Text = teamTwo.Name; listviewTeamTwo.ItemsSource = PlayersTeamTwo; if ( team1Name.SelectedIndex != -1 && team2Name.SelectedIndex != -1 ) { AddScore.IsEnabled = true; } }
public TeamInformationModel(List<Player> list, Team team) { TeamPlayers = list; Team = team; }
private void Save_Click(object sender, RoutedEventArgs e) { bool validated; string teamName; string managerName; string phoneName; string emailName; string filepath; string path; Team teamToSave; PlayerInTeam plInTeam; Dictionary<string, string> teamDict; Dictionary<string, string> plDict; Dictionary<string, string> plInTeamDict; teamName = team.Text; managerName = manager.Text; phoneName = phone.Text; emailName = email.Text; path = imageUrl.Text; validated = ValidateTeam(teamName, managerName, emailName, league, phoneName, imageUrl.Text); if (validated) { baseDirectoryPath = AppDomain.CurrentDomain.BaseDirectory; baseDirectoryToCombine = baseDirectoryPath.Remove(baseDirectoryPath.Length - 21, 21); string guidToDB = Guid.NewGuid().ToString() + System.IO.Path.GetExtension(openFileDlg.FileName); filepath = baseDirectoryToCombine + "VolleyballMvc\\Content\\Images\\" + guidToDB; File.Copy(Path.GetFullPath(path), filepath); teamToSave = new Team(league, teamName, managerName, phoneName, emailName, guidToDB); teamDict = teamToSave.ConvertInstanceToDictionary(); client.Insert(teamDict, Middleware.VolleyballService.TablesNames.Teams); foreach (var player in playersList) { plInTeam = new PlayerInTeam(teamToSave, player, DateTime.Now.Year); plDict = player.ConvertInstanceToDictionary(); plInTeamDict = plInTeam.ConvertInstanceToDictionary(); client.Insert(plDict, Middleware.VolleyballService.TablesNames.Players); client.Insert(plInTeamDict, Middleware.VolleyballService.TablesNames.PlayerInTeams); } this.Visibility = Visibility.Hidden; } }