private void BuildDraft(PlayerInfoDto player, string draftInfo)
 {
     var draftValues = draftInfo.Split(' ');
     player.DraftYear = int.Parse(draftValues[(int)EnumDraftValues.Year]);
     player.Round = int.Parse(draftValues[(int)EnumDraftValues.Round]);
     player.Pick = int.Parse(draftValues[(int)EnumDraftValues.Pick]);
 }
        /// <summary>
        /// Table looks like this:
        /// # - Player - Pos.- DOB - AGE - HT - WT - School - Org. Team - Draft Status - NFL Exp.
        /// 53 - Bradham, Nigel, - OLB - 09/17/1989 - 6' 02&quot; - 204 - Florida State - 12 04 105 - 4
        /// </summary>
        public void Write()
        {
            string currentTeam = "BUF";

            var webClient = new WebClient();
            string page = webClient.DownloadString("C:\\Userdata\\FantasyFootball\\DataWriters\\TestData\\Buffalo.html");

            var doc = new HtmlAgilityPack.HtmlDocument();
            doc.LoadHtml(page);

            List<List<string>> table = doc.DocumentNode.SelectSingleNode("//table[@class='th_BUF']")
                        .Descendants("tr")
                        .Skip(1)
                        .Where(tr => tr.Elements("td").Count() > 1)
                        .Select(tr => tr.Elements("td").Select(td => td.InnerText.Trim()).ToList())
                        .ToList();

            IList<PlayerInfoDto> players = new List<PlayerInfoDto>();
            int exceptionCount = 0;

            foreach (var playerValues in table)
            {
                exceptionCount++;
                if (playerValues.Count != 11)
                {
                    throw new Exception(string.Format("player at line {0} does not have the correct number of fields",
                        exceptionCount));
                }
                var player = new PlayerInfoDto
                {
                    Number = int.Parse(playerValues[(int) EnumPlayerValuesIndex.Number]),
                    Name = playerValues[(int) EnumPlayerValuesIndex.Name],
                    Position = playerValues[(int) EnumPlayerValuesIndex.Postion],
                    DateOfBirth =
                        DateTime.ParseExact(playerValues[(int) EnumPlayerValuesIndex.DateOfBirth], "MM/dd/yyyy",
                            CultureInfo.InvariantCulture),
                    Height = playerValues[(int) EnumPlayerValuesIndex.Height],
                    Weight = playerValues[(int) EnumPlayerValuesIndex.Weight],
                    School = playerValues[(int) EnumPlayerValuesIndex.School],
                    Team = currentTeam
                };
                BuildDraft(player, playerValues[(int) EnumPlayerValuesIndex.Draft]);
                players.Add(player);
            }

            SubmitToService(players);
        }