예제 #1
0
 public PlayerInTeam( Team team , Player player, int year )
     : base()
 {
     this.teamId = team.Id;
     this.playerId = player.Id;
     this.year = year;
 }
예제 #2
0
 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();
 }
예제 #3
0
파일: Game.cs 프로젝트: gaidanna/Volleyball
 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;
 }
예제 #4
0
 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;
     }
 }
예제 #5
0
        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));
        }
예제 #6
0
        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;
            }
        }
예제 #7
0
 public TeamInformationModel(List<Player> list, Team team)
 {
     TeamPlayers = list;
     Team = team;
 }
예제 #8
0
        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;
            }
        }