Beispiel #1
0
 public bool AddCyclist(Cyclist cyclist)
 {
     cyclist.Id = cyclistDao.Add(cyclist);
     if (cyclist.Id > 0)
     {
         ViewModelManager.GetCollection().AllCyclists.Add(cyclist);
         return(true);
     }
     return(false);
 }
Beispiel #2
0
        public bool AddTeam(string name, string country)
        {
            var team = new CyclistTeam(0, name, country);

            try
            {
                team.Id = cyclistTeamDao.Add(team);

                if (team.Id > 0)
                {
                    ViewModelManager.GetCollection().AllTeams.Add(team);
                    return(true);
                }
                return(false);
            }
            catch (Exception e)
            {
                Debug.WriteLine(e.Message);
                return(false);
            }
        }
Beispiel #3
0
 public ObservableCollection <Cyclist> GetAllCyclists()
 {
     return(ViewModelManager.GetCollection().AllCyclists = new ObservableCollection <Cyclist>(cyclistDao.GetAll()));
 }
Beispiel #4
0
 public ObservableCollection <CyclistTeam> GetAllTeams()
 {
     return(ViewModelManager.GetCollection().AllTeams = new ObservableCollection <CyclistTeam>(cyclistTeamDao.GetAll()));
 }