Exemplo n.º 1
0
        public string Render()
        {
            var t      = UnitTable();
            var strRet = HtmlLib.TableData(t.Render());

            return(strRet);
        }
Exemplo n.º 2
0
        private static string FooterRow(string label, string fmt, double amt)
        {
            string row =
                HtmlLib.TableRowOpen() + HtmlLib.TableData(label) +
                HtmlLib.TableDataAttr(string.Format(fmt, amt), "ALIGN='RIGHT'")
                + HtmlLib.TableRowClose();

            return(row);
        }
Exemplo n.º 3
0
        private static string FooterRow(string label, string fmt, string msg)
        {
            string row =
                HtmlLib.TableRowOpen() + HtmlLib.TableData(label) +
                HtmlLib.TableData(string.Format(fmt, msg))
                + HtmlLib.TableRowClose();

            return(row);
        }
Exemplo n.º 4
0
        private string GameBlock()
        {
            string s;

            if (_game != null)
            {
                var weekOut = Int32.Parse(_game.Week) > 17 ? "PO" : "W" + _game.Week;
                if (_game.Week.Equals("21"))
                {
                    weekOut = "SB";
                }
                s = HtmlLib.TableOpen("BORDER='1' CELLSPACING='3' CELLPADDING='3'") +
                    HtmlLib.TableRowOpen() +
                    HtmlLib.TableData(_game.AussieDate()) +
                    HtmlLib.TableData(_game.AussieHour(true)) +
                    HtmlLib.TableData(weekOut) +
                    HtmlLib.TableData(_game.Season) +
                    HtmlLib.TableRowClose() +
                    HtmlLib.TableRowOpen() +
                    HtmlLib.TableData(HtmlLib.Bold(_game.HomeTeamName), SetColour(true)) +
                    HtmlLib.TableData("vs. " + _game.AwayTeamName, SetColour(false)) +
                    HtmlLib.TableData(_game.Spread.ToString()) +
                    HtmlLib.TableData(_game.Total.ToString()) +
                    HtmlLib.TableRowClose() +
                    HtmlLib.TableRowOpen();
                if (_game.HomeNflTeam != null)
                {
                    s += HtmlLib.TableData(_game.HomeNflTeam.RecordOut());
                }
                else
                {
                    s += HtmlLib.TableData(" ");
                }
                if (_game.AwayNflTeam != null)
                {
                    s += HtmlLib.TableData(_game.AwayNflTeam.RecordOut());
                }
                else
                {
                    s += HtmlLib.TableData(" ");
                }

                s += HtmlLib.TableData("") +
                     HtmlLib.TableData("") +
                     HtmlLib.TableRowClose() +
                     HtmlLib.TableClose();
            }
            else
            {
                s = "no game object";
            }
            return(s);
        }
Exemplo n.º 5
0
        private string DumpLineups()
        {
            var sb = new StringBuilder();

            sb.Append(HtmlLib.TableOpen("border='0'"));
            sb.Append(HtmlLib.TableRowOpen());
            sb.Append(HtmlLib.TableData(Game.HomeLineup.DumpAsHtml("Home Lineup")));
            sb.Append(HtmlLib.TableData(Game.AwayLineup.DumpAsHtml("Away Lineup")));
            sb.Append(HtmlLib.TableRowClose());
            sb.Append(HtmlLib.TableClose());
            return(sb.ToString());
        }
Exemplo n.º 6
0
        private string DumpPlayerGameMetrics()
        {
            var sb = new StringBuilder();

            sb.Append(HtmlLib.TableOpen("border='0'"));
            sb.Append(HtmlLib.TableRowOpen());
            sb.Append(HtmlLib.TableData(Game.DumpPgmsAsHtml("Home PGMs", Game.HomeTeam)));
            sb.Append(HtmlLib.TableData(Game.DumpPgmsAsHtml("Away PGMS", Game.AwayTeam)));
            sb.Append(HtmlLib.TableRowClose());
            sb.Append(HtmlLib.TableClose());
            return(sb.ToString());
        }
Exemplo n.º 7
0
        private string DumpFantasyPlayers()
        {
            var sb = new StringBuilder();

            sb.Append(HtmlLib.TableOpen("border='0'"));
            sb.Append(HtmlLib.TableRowOpen());
            sb.Append(HtmlLib.TableData(Game.DumpFantasyPlayersAsHtml("Home Fantasy Players", Game.HomeTeam)));
            sb.Append(HtmlLib.TableData(Game.DumpFantasyPlayersAsHtml("Away Fantasy Players", Game.AwayTeam)));
            sb.Append(HtmlLib.TableRowClose());
            sb.Append(HtmlLib.TableClose());
            return(sb.ToString());
        }
Exemplo n.º 8
0
        public string DumpAsHtml(string header)
        {
            var sb = new StringBuilder();

            sb.Append(HtmlLib.H3(header));
            sb.Append(HtmlLib.TableOpen("border='0'"));
            sb.Append(HtmlLib.TableRowOpen());
            sb.Append(HtmlLib.TableData(DumpOffenceHtml()));
            sb.Append(HtmlLib.TableData(DumpDefenceHtml()));
            sb.Append(HtmlLib.TableRowClose());
            sb.Append(HtmlLib.TableClose());
            return(sb.ToString());
        }
Exemplo n.º 9
0
        private static string Header(string cHeading)
        {
            var htmlOut = HtmlLib.TableOpen("class='title' cellpadding='0' cellspacing='0' width='100%'") + "\n\t"
                          + HtmlLib.TableRowOpen(TopLine()) + "\n\t\t"
                          + HtmlLib.TableDataAttr(HtmlLib.Bold(cHeading), "colspan='2' class='gponame'") + "\n\t"
                          + HtmlLib.TableRowClose() + "\n\t"
                          + HtmlLib.TableRowOpen() + "\n\t\t"
                          + HtmlLib.TableDataAttr(TopLine(), "id='dtstamp'") + "\n\t\t"
                          + HtmlLib.TableData(HtmlLib.Div("objshowhide", "tabindex='0'")) + "\n\t"
                          + HtmlLib.TableRowClose() + "\n"
                          + HtmlLib.TableClose() + "\n";

            return(htmlOut);
        }
Exemplo n.º 10
0
        private string AwayLine(NFLResult prediction)
        {
            var sb = new StringBuilder();

            sb.Append(HtmlLib.TableRowOpen());
            sb.Append(HtmlLib.TableData(Game.AwayTeam));
            sb.Append(HtmlLib.TableData(ScoreOut(prediction.AwayScore, Game.AwayScore)));
            sb.Append(HtmlLib.TableData(ScoreOut(prediction.AwayTDp, Game.AwayTDp)));
            sb.Append(HtmlLib.TableData(ScoreOut(prediction.AwayTDr, Game.AwayTDr)));
            sb.Append(HtmlLib.TableData(ScoreOut(prediction.AwayFg, Game.AwayFg)));
            sb.Append(HtmlLib.TableData(ScoreOut(prediction.AwayTDd, Game.AwayTDd)));
            sb.Append(HtmlLib.TableData(ScoreOut(prediction.AwayTDs, Game.AwayTDs)));
            sb.Append(HtmlLib.TableRowClose());
            return(sb.ToString());
        }
Exemplo n.º 11
0
        private string Header(string cHeading)
        {
            var htmlOut = HtmlLib.TableOpen("class='title' cellpadding='0' cellspacing='0'") + "\n\t"
                          + HtmlLib.TableRowOpen() + "\n\t\t"
                          + HtmlLib.TableDataAttr(cHeading, "colspan='2' class='gponame'") + "\n\t"
                          + HtmlLib.TableRowClose() + "\n\t"
                          + HtmlLib.TableRowOpen() + "\n\t\t"
                          + HtmlLib.TableDataAttr("Report Date:" + DateTime.Now.ToString("dd MMM yy  HH:mm") +
                                                  "   elapsed:" + TimeTaken, "id='dtstamp'") + "\n\t\t"
                          + HtmlLib.TableData(HtmlLib.Div("objshowhide", "tabindex='0'")) + "\n\t"
                          + HtmlLib.TableRowClose() + "\n"
                          + HtmlLib.TableClose() + "\n";

            return(htmlOut);
        }
Exemplo n.º 12
0
        public string PerfRow()
        {
            if ((TeamCode == null) || (TeamCode == "??") || (TeamCode == "bye"))
            {
                return(String.Empty);
            }

            return(HtmlLib.TableRowOpen(RowClass()) + "\n"
                   + HtmlLib.TableData(String.Format("{0}:{1:0#}", Season, Week)) + "\n"
                   + HtmlLib.TableData(GameOut()) + "\n"
                   + HtmlLib.TableData(Game.GameDate.ToString("dd/MM/yyyy")) + "\n"
                   + HtmlLib.TableData(ResultOut()) + "\n"
                   + HtmlLib.TableData(PerfStats.Stat1(_thePlayer.PlayerCat, false)) + "\n"
                   + HtmlLib.TableData(PerfStats.Stat2(_thePlayer.PlayerCat)) + "\n"
                   + HtmlLib.TableRowClose() + "\n");
        }
Exemplo n.º 13
0
        private string Footer()
        {
            var htmlOut = HtmlLib.TableOpen("class='title' cellpadding='0' cellspacing='0'") + "\n\t"
                          + HtmlLib.TableRowOpen() + "\n\t\t"
                          + HtmlLib.TableDataAttr(_footer, "colspan='2' class='gponame'") + "\n\t"
                          + HtmlLib.TableRowClose() + "\n\t";

            if (ShowElapsedTime)
            {
                htmlOut += HtmlLib.TableRowOpen() + "\n\t\t"
                           + HtmlLib.TableDataAttr("elapsed time:" + TimeTaken, "id='dtstamp'") + "\n\t\t"
                           + HtmlLib.TableData(HtmlLib.Div("objshowhide", "tabindex='0'")) + "\n\t"
                           + HtmlLib.TableRowClose() + "\n";
            }
            htmlOut += HtmlLib.TableClose() + "\n";
            return(htmlOut);
        }
Exemplo n.º 14
0
        private string TotalLine(int[] tot)
        {
            var tl = "";

            if (!Totals)
            {
                return("");
            }

            if (Body != null)
            {
                tl = HtmlLib.TableRowOpen();
                if (DoRowNumbers)
                {
                    tl += HtmlLib.TableDataAttr("Totals", "ALIGN='RIGHT' VALIGN='TOP'");
                }

                for (int i = 0; i < _columns.Count; i++)
                {
                    var col = ( ReportColumn )_columns[i];
                    if (col.CanAccumulate)
                    {
                        var dc    = Body.Columns[col.Source];
                        var sData = FormatData(dc, col.Format, tot[i].ToString(CultureInfo.InvariantCulture));
                        tl       += HtmlLib.TableDataAttr(sData, AttrFor(dc, (ReportColumn.ColourDelegate)null, ""));
                        LastTotal = tot[i];
                    }
                    else if (col.ColumnTotalDelegate != null)
                    {
                        string output = col.ColumnTotalDelegate();
                        tl += HtmlLib.TableDataAttr(output, "ALIGN='CENTER' VALIGN='TOP'");
                    }
                    else
                    {
                        tl += HtmlLib.TableData(HtmlLib.HtmlPad("", 1));
                    }
                }
                tl += HtmlLib.TableRowClose();
            }
            return(tl);
        }
Exemplo n.º 15
0
        private string AverageLine(int[] tot, int rowCount)
        {
            var tl = "";

            if (!Totals)
            {
                return("");
            }

            if (Body != null)
            {
                tl = HtmlLib.TableRowOpen();
                if (DoRowNumbers)
                {
                    tl += HtmlLib.TableDataAttr("Averages", "ALIGN='RIGHT' VALIGN='TOP'");
                }

                for (int i = 0; i < _columns.Count; i++)
                {
                    var col = ( ReportColumn )_columns[i];
                    if (col.CanAccumulate)
                    {
                        var dc    = Body.Columns[col.Source];
                        var sData = FormatData(dc, "{0:0.0}", string.Format("{0:0.0}", (( decimal )tot[i] / ( decimal )rowCount)));
                        tl       += HtmlLib.TableDataAttr(sData, AttrFor(dc, (ReportColumn.ColourDelegate)null, ""));
                        LastTotal = tot[i];
                    }
                    else if (col.ColumnTotalDelegate != null)
                    {
                        string output = col.ColumnTotalDelegate();
                        tl += HtmlLib.TableDataAttr(output, "ALIGN='CENTER' VALIGN='TOP'");
                    }
                    else
                    {
                        tl += HtmlLib.TableData(HtmlLib.HtmlPad("", 1));
                    }
                }
                tl += HtmlLib.TableRowClose();
            }
            return(tl);
        }
Exemplo n.º 16
0
        public string Render()
        {
            var no      = String.Empty;
            var drafted = "";

            if (_mName.Length > 0)
            {
                _mBgColour = _mPlayer.SetColour("RED");
                no         = _mPlayer.JerseyNo;
                if (_mPlayer.IsNewbie())
                {
                    _mName = _mPlayer.Url(HtmlLib.Italics(HtmlLib.Bold(_mName)));
                }
//            drafted = string.Format( " {0} {1}", mPlayer.Drafted, (int) mPlayer.ExperiencePoints );
                drafted = string.Format(" {0} {1}", _mPlayer.Drafted, "");
            }

            var t = PlayerTable(drafted, no);

            var strRet = HtmlLib.TableData((Offset ? "<br>" : "") + t.Render());

            return(strRet);
        }
Exemplo n.º 17
0
        public string RenderAsHtml()
        {
            var    s = HtmlLib.TableRowOpen();
            string sOpp;

            //  three rows
            s += HtmlLib.TableData(_team.TeamUrl()) + HtmlLib.TableData("");
            for (var i = 1; i < 18; i++)
            {
                s += HtmlLib.TableDataAttr(HtmlLib.Font("ARIAL", i.ToString(), "-2"),
                                           "ALIGN='CENTER' BGCOLOR='MOCCASIN'"); //  week number row
            }
            s += HtmlLib.TableRowClose();

            //  Row 2  Schedule this year
            s += HtmlLib.TableRowOpen() +
                 HtmlLib.TableDataAttr(Label1Out(), Colour1Out() + " ALIGN='CENTER'");
            s += HtmlLib.TableData(_metricName);
            for (var j = 0; j < Constants.K_WEEKS_IN_REGULAR_SEASON; j++)
            {
                if ((_opps[j].Opponent == "BYE") || (_opps[j].Opponent.Trim().Length == 0))
                {
                    sOpp = _opps[j].Opponent;
                }
                else
                {
                    sOpp = (_opps[j].IsHome() ? "v" : "@") + TeamUrl(_opps[j].Opponent);
                }
                s += HtmlLib.TableDataAttr(sOpp, "ALIGN='CENTER'" + OpponentColour(_opps[j].Opponent));
            }
            s += HtmlLib.TableRowClose();

            if (AddBlankRow)
            {
                s += HtmlLib.TableRowOpen() + HtmlLib.TableDataAttr(HtmlLib.HtmlPad("", 2), "ALIGN='CENTER'");
                s += HtmlLib.TableDataAttr(HtmlLib.HtmlPad("", 2), "ALIGN='RIGHT' BGCOLOR='WHITE'");

                for (var k = 0; k < Constants.K_WEEKS_IN_REGULAR_SEASON; k++)
                {
                    s += HtmlLib.TableDataAttr(HtmlLib.HtmlPad("", 2), string.Format("ALIGN='CENTER' BGCOLOR='{0}'", "WHITE"));
                }
                s += HtmlLib.TableRowClose();
            }
            //  Row 3 Total  (W-L) tot spread
            s += HtmlLib.TableRowOpen() +
                 HtmlLib.TableDataAttr(Stats1Out(), "ALIGN='CENTER'");
            s += HtmlLib.TableDataAttr(
                HtmlLib.Bold(_total.ToString()),
                string.Format("ALIGN='RIGHT' BGCOLOR='{0}'", TotalColour()));

            for (var k = 0; k < Constants.K_WEEKS_IN_REGULAR_SEASON; k++)
            {
                var mBit = LinkedCellContent(_opps[k], k, _team.TeamCode);
                s += mBit;
            }
            if (_metricName == "Spread")
            {
                //  Additional Row 4 last year's spreads
                s += HtmlLib.TableRowOpen() + HtmlLib.TableDataAttr(Stats2Out(), "ALIGN='CENTER'");
                s += HtmlLib.TableData("prev");
                for (var l = 0; l < Constants.K_WEEKS_IN_REGULAR_SEASON; l++)
                {
                    if ((_prevOpp[l].Opponent == "BYE") || (_prevOpp[l].Opponent.Length == 0))
                    {
                        sOpp = _prevOpp[l].Opponent;
                    }
                    else
                    {
                        sOpp = (_prevOpp[l].IsHome() ? "v" : "@")
                               + MatchupUrl(l + 1, _team.TeamCode, _prevOpp[l].Opponent, _prevOpp[l].IsHome());
                    }
                    s += HtmlLib.TableDataAttr(sOpp, "ALIGN='CENTER'" +
                                               OpponentColour(_prevOpp[l].Opponent));
                }
                s += HtmlLib.TableRowClose();
                //  Row 5 last years results
                s += HtmlLib.TableRowOpen() + HtmlLib.TableDataAttr(Stats3Out(), "ALIGN='CENTER'");                    // W-L
                s += HtmlLib.TableDataAttr(TotalPrev().ToString(), "ALIGN='RIGHT'");
                for (var m = 0; m < Constants.K_WEEKS_IN_REGULAR_SEASON; m++)
                {
                    var mBit = CellContent(_prevOpp[m]);
                    s += mBit;
                }
                s += HtmlLib.TableRowClose();
            }

            return(s);
        }
Exemplo n.º 18
0
 private string AddFooterLine(string label, int amount)
 {
     return(HtmlLib.TableRowOpen() + HtmlLib.TableData(label) +
            HtmlLib.TableDataAttr(amount.ToString(), "ALIGN='RIGHT'") +
            HtmlLib.TableRowClose());
 }
Exemplo n.º 19
0
 private string AddFooterLine(string label, decimal amount)
 {
     return(HtmlLib.TableRowOpen() + HtmlLib.TableData(label) +
            HtmlLib.TableDataAttr(string.Format("{0:##0.0}", amount), "ALIGN='RIGHT'") +
            HtmlLib.TableRowClose());
 }
Exemplo n.º 20
0
 private static string BlankCol()
 {
     return(HtmlLib.TableData("&nbsp;") + "\n\t");
 }