コード例 #1
0
ファイル: PlayerInTeam.cs プロジェクト: gaidanna/Volleyball
 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
ファイル: AddPlayer.xaml.cs プロジェクト: gaidanna/Volleyball
 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
ファイル: TeamController.cs プロジェクト: gaidanna/Volleyball
        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
ファイル: AddGame.xaml.cs プロジェクト: gaidanna/Volleyball
        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
ファイル: TeamModel.cs プロジェクト: gaidanna/Volleyball
 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;
            }
        }