Exemplo n.º 1
0
        public GsTeam GetTeam(string ownerCode)
        {
            GsTeam selectedTeam = null;

            if (_teamList != null)
            {
                foreach (var t in from GsTeam t in _teamList where t.OwnerId.Equals(ownerCode) select t)
                {
                    selectedTeam = t;
                    break;
                }
            }
            return(selectedTeam);
        }
Exemplo n.º 2
0
        public void LoadTeams()
        {
            _teamList = new ArrayList();
            //  Part 1 - Get the Teams for the season
            DataSet   ds = _tflWs.GetFTeamsDs(Season, CompCode);
            DataTable dt = ds.Tables["comp"];

            //  Part 2 - Iterate through the teams
            foreach (DataRow dr in dt.Rows)
            {
                GsTeam t = new GsTeam(dr, CompCode, this);

                _teamList.Add(t);
            }
        }
Exemplo n.º 3
0
        public GsTeam GetTeam(string ownerCode)
        {
            GsTeam selectedTeam = null;

            if (_teamList != null)
            {
                foreach (GsTeam t in _teamList)
                {
                    if (t.OwnerId.Equals(ownerCode))
                    {
                        selectedTeam = t;
                        break;
                    }
                }
            }
            return(selectedTeam);
        }
Exemplo n.º 4
0
        private static void BuildReportDataset(SimpleTableReport str, string fTeamOwner, NFLWeek week, GsTeam t)
        {
            if (week != null)
            {
                if ((t != null) && (t.OwnerId == fTeamOwner))
                {
                    foreach (NFLGame g in week.GameList())
                    {
                        if (g != null)
                        {
                            var theGame = g.Hour == null ? new NFLGame(g.GameKey()) : g;
                            //RosterLib.Utility.Announce(string.Format("Doing game {0}", theGame.GameCode ) );
                            var dr = str.Body.NewRow();
                            //RosterLib.Utility.Announce(string.Format("Rating game {0}", theGame.GameCode));
                            dr["RATING"] = t.RateGame(theGame);
                            //RosterLib.Utility.Announce(string.Format("Setting Day {0}", theGame.GameCode));
                            dr["DAY"] = string.Format("{0} {1}",
                                                      theGame.AussieDateTime().DayOfWeek.ToString().Substring(0, 3),
                                                      theGame.AussieDateTime().Day);
                            //RosterLib.Utility.Announce(string.Format("Setting Hour {0}", theGame.GameCode));
                            dr["HOUR"] = theGame.AussieHour(false);
                            //RosterLib.Utility.Announce(string.Format("Setting Names {0}",theGame.GameCode));
                            dr["AT"] = theGame.AwayNflTeam == null ? theGame.AwayTeam : theGame.AwayNflTeam.Name;
                            dr["HT"] = theGame.AwayNflTeam == null ? theGame.HomeTeam : theGame.HomeNflTeam.Name;
                            //RosterLib.Utility.Announce(string.Format("Setting TV {0}", theGame.GameCode));
                            dr["TV"] = theGame.IsOnTv ? "*" : "";
                            //RosterLib.Utility.Announce(string.Format("Setting Spread Fav {0}", theGame.GameCode));

                            dr["FAV"] = theGame.SpreadFavourite();
                            //RosterLib.Utility.Announce(string.Format("Setting Spread {0}", theGame.GameCode));
                            dr["SPREAD"] = theGame.Spread.ToString();
                            //RosterLib.Utility.Announce(string.Format("Setting myTip {0}", theGame.GameCode));
                            if (theGame.MyTip != null)
                            {
                                if (theGame.MyTip.Trim().Length > 0)
                                {
                                    dr["TIP"] = Equals(theGame.MyTip.Substring(0, 1), "H") ? theGame.HomeTeam : theGame.AwayTeam;
                                }
                            }

                            str.Body.Rows.Add(dr);
                        }
                    }
                }
            }
            else
            {
                Utility.Announce(string.Format("BuildReportDataSet: null week"));
            }
        }
Exemplo n.º 5
0
        private static void BuildReportDataset(SimpleTableReport str, string fTeamOwner, NFLWeek week, GsTeam t)
        {
            if (week != null)
            {
                if ( ( t != null ) && ( t.OwnerId == fTeamOwner ) )
                {
                    foreach ( NFLGame g in week.GameList() )
                    {
                        if ( g != null )
                        {
                            var theGame = g.Hour == null ? new NFLGame( g.GameKey() ) : g;
                            //RosterLib.Utility.Announce(string.Format("Doing game {0}", theGame.GameCode ) );
                            var dr = str.Body.NewRow();
                            //RosterLib.Utility.Announce(string.Format("Rating game {0}", theGame.GameCode));
                            dr[ "RATING" ] = t.RateGame( theGame );
                            //RosterLib.Utility.Announce(string.Format("Setting Day {0}", theGame.GameCode));
                            dr[ "DAY" ] = string.Format( "{0} {1}",
                                                                  theGame.AussieDateTime().DayOfWeek.ToString().Substring( 0, 3 ),
                                                                  theGame.AussieDateTime().Day );
                            //RosterLib.Utility.Announce(string.Format("Setting Hour {0}", theGame.GameCode));
                            dr[ "HOUR" ] = theGame.AussieHour( false );
                            //RosterLib.Utility.Announce(string.Format("Setting Names {0}",theGame.GameCode));
                            dr[ "AT" ] = theGame.AwayNflTeam == null ? theGame.AwayTeam : theGame.AwayNflTeam.Name;
                            dr[ "HT" ] = theGame.AwayNflTeam == null ? theGame.HomeTeam : theGame.HomeNflTeam.Name;
                            //RosterLib.Utility.Announce(string.Format("Setting TV {0}", theGame.GameCode));
                            dr[ "TV" ] = theGame.IsOnTv ? "*" : "";
                            //RosterLib.Utility.Announce(string.Format("Setting Spread Fav {0}", theGame.GameCode));

                            dr[ "FAV" ] = theGame.SpreadFavourite();
                            //RosterLib.Utility.Announce(string.Format("Setting Spread {0}", theGame.GameCode));
                            dr[ "SPREAD" ] = theGame.Spread.ToString();
                            //RosterLib.Utility.Announce(string.Format("Setting myTip {0}", theGame.GameCode));
                            if ( theGame.MyTip != null )
                            {
                                if ( theGame.MyTip.Trim().Length > 0 )
                                    dr[ "TIP" ] = Equals( theGame.MyTip.Substring( 0, 1 ), "H" ) ? theGame.HomeTeam : theGame.AwayTeam;
                            }

                            str.Body.Rows.Add( dr );
                        }
                    }
                }
            }
            else
                Utility.Announce(string.Format("BuildReportDataSet: null week"));
        }
Exemplo n.º 6
0
        public void LoadTeams()
        {
            _teamList = new ArrayList();
            //  Part 1 - Get the Teams for the season
            DataSet ds = _tflWs.GetFTeamsDs( Season, CompCode );
            DataTable dt = ds.Tables["comp"];

            //  Part 2 - Iterate through the teams
            foreach (DataRow dr in dt.Rows)
            {
                GsTeam t = new GsTeam( dr, CompCode, this );

                _teamList.Add( t );
            }
        }