Exemplo n.º 1
0
        public TreningViewModel(Wellness.Model.Requests.ClanViewRequest clan, bool historyOnly = false)
        {
            _apiService               = new APIService("trening");
            _apiService_TipTreninga   = new APIService("TipTreninga");
            _apiService_ClanPrisustvo = new APIService("ClanPrisustvo");
            _clan        = clan;
            _historyOnly = historyOnly;
            //--------------------------------------------------------
            Trening      = new ObservableCollection <Mobile.Models.TreningModel>();
            TipTreninga  = new ObservableCollection <Wellness.Model.TipTreninga>();
            SearchFilter = new ObservableCollection <string>();

            InitCommand = new Command(async() => await Init());


            SearchFilter.Add("Svi");
            SearchFilter.Add("Prijavljeni");
            SearchFilter.Add("Ne prijavljeni");
            _selectedSearchFilter = SearchFilter[0];
            var SviTipTreninga = new TipTreninga()
            {
                Id           = 0,
                TipTreninga1 = "Svi"
            };

            TipTreninga.Add(SviTipTreninga);

            var listTipTreninga = AsyncHelpers.RunSync <List <Wellness.Model.TipTreninga> >(() => _apiService_TipTreninga.Get <List <Wellness.Model.TipTreninga> >(null));

            foreach (Wellness.Model.TipTreninga x in listTipTreninga)
            {
                TipTreninga.Add(x);
            }
            _selectedTipTreninga = TipTreninga[0];
        }
Exemplo n.º 2
0
 public Trening(DateTime datumOdrzavanja, int kapacitet, string opis, List <Clan> prijavljeniClanovi, TipTreninga tip, Trener trener)
 {
     DatumOdrzavanja    = datumOdrzavanja;
     Kapacitet          = kapacitet;
     Opis               = opis;
     PrijavljeniClanovi = prijavljeniClanovi;
     Tip    = tip;
     Trener = trener;
     ID     = 0;
 }