public CollegeTeams GetCollege(string teamName)
        {
            var team = new CollegeTeams();

            if (File.Exists(path))
            {
                using (var sr = new StreamReader(path))
                {
                    string line;
                    while ((line = sr.ReadLine()) != null)
                    {
                        var         elems       = line.Split(',');
                        string      stringPath  = elems[3].ToString();
                        Uri         imageUri    = new Uri(stringPath, UriKind.Relative);
                        BitmapImage imageBitmap = new BitmapImage(imageUri);
                        var         teamInfo    = new CollegeTeams()
                        {
                            CollegeTeamName = elems[0],
                            CollegeLocation = elems[1],
                            CollegeRanking  = Int32.Parse(elems[2]),
                            CollegeIcon     = elems[3],
                            DateOfRanking   = elems[5]
                        };
                    }
                }
            }
            return(team);
        }
        public IEnumerable <CollegeTeams> GetColleges()
        {
            var teams = new List <CollegeTeams>();

            if (File.Exists(path))
            {
                using (var sr = new StreamReader(path))
                {
                    string line;
                    while ((line = sr.ReadLine()) != null)
                    {
                        var    elems      = line.Split('^');
                        string stringPath = elems[3].ToString();
                        var    team       = new CollegeTeams()
                        {
                            CollegeTeamName = elems[0],
                            CollegeLocation = elems[1],
                            CollegeRanking  = Int32.Parse(elems[2]),
                            CollegeIcon     = elems[3],
                            DateOfRanking   = elems[5]
                        };
                        teams.Add(team);
                    }
                }
            }
            return(teams);
        }
Пример #3
0
        public CollegeTeams GetCollege(string teamName)
        {
            List <CollegeTeams> collegeTeam = LoadCollegeTeams();
            CollegeTeams        getTeamName = collegeTeam.Where(t => t.CollegeTeamName == teamName).FirstOrDefault();

            return(getTeamName);
        }
 public void UpdateCollege(string planetName, CollegeTeams updatedCollege)
 {
     throw new NotImplementedException();
 }
 public void AddCollege(CollegeTeams newCollege)
 {
     throw new NotImplementedException();
 }
Пример #6
0
 public void UpdateCollege(string teamName, CollegeTeams updatedCollege)
 {
     ServiceProxy.UpdateCollege(teamName, updatedCollege);
 }
Пример #7
0
 public void AddCollege(CollegeTeams newCollege)
 {
     ServiceProxy.AddCollege(newCollege);
 }