コード例 #1
0
        /// <summary>
        ///   Find a single player
        /// </summary>
        /// <param name="firstName"></param>
        /// <param name="lastName"></param>s
        /// <returns></returns>
        public NFLPlayer GetNflPlayer(
            string firstName,
            string lastName)
        {
            //Logger.Trace($"GetNflPlayer calling DataLibrarian {firstName} {lastName}");
            var ds   = TflDataLibrarian.GetPlayer(firstName, lastName);
            var list = (from DataRow dr in ds.Tables[0].Rows
                        select new NFLPlayer(dr, string.Empty)).ToList();

            //Logger.Trace($"GetNflPlayer found {list.Count} records");
            return(list.Count > 0 ? list[0] : null);
        }
コード例 #2
0
        private string GetPlayerIdFor(
            string playerName)
        {
            var part = playerName.Split(
                new Char[] { ' ', ',' },
                StringSplitOptions.RemoveEmptyEntries);
            var id = string.Empty;

            if (part.Length < 2)
            {
                return(id);
            }
            var dsResult = _librarian.GetPlayer(
                part[0],
                part[1]);

            foreach (DataRow row in dsResult.Tables[0].Rows)
            {
                id = row["PLAYERID"].ToString();
                if (row["CURRTEAM"].ToString() != "??")
                {
                    break;
                }
            }
            return(id);
        }
コード例 #3
0
        private string GetPlayerIdFor(
            string playerName)
        {
            var part = playerName.Split(
                new Char[] { ' ', ',' },
                StringSplitOptions.RemoveEmptyEntries);
            var dsResult = _librarian.GetPlayer(
                part[0],
                part[1]);
            var id = string.Empty;

            foreach (DataRow row in dsResult.Tables[0].Rows)
            {
                var firstName = row["FIRSTNAME"].ToString().Trim();
                var surname   = row["SURNAME"].ToString().Trim();
                if (firstName == part[0] && surname == part[1])
                {
                    id = row["PLAYERID"].ToString();
                    break;
                }
            }
            return(id);
        }