private async void DatePicker_DateSelected(object sender, DateChangedEventArgs e) { //pronalazak id trenutno logovanog korisnika try { var searchKandidat = new KandidatSearchRequest() { KorisnikId = APIService.trenutniKorisnik.Id }; //pretraga kandidata sa tim korisnickim nalogom var kandidat = await _kandidati.Get <List <MKandidat> >(searchKandidat); if (kandidat == null) { throw new Exception("Ne postoje evidentirani termini!"); } var search = new TerminRCSearchRequest() { KandidatId = kandidat[0].Id, Datum = e.NewDate }; //prikaz termina pronadjenog korisnika await model.PrikaziTermine(search); } catch (Exception ex) { await Application.Current.MainPage.DisplayAlert("Obavjestenje!", "Nemate termine", "OK"); } }
protected async override void OnAppearing() { base.OnAppearing(); try { //vraca termine za trenutno ulogovanog kandidata var searchKandidat = new KandidatSearchRequest() { KorisnikId = APIService.trenutniKorisnik.Id }; //pretraga kandidata sa tim korisnickim nalogom var kandidat = await _kandidati.Get <List <MKandidat> >(searchKandidat); if (kandidat == null) { throw new Exception("Ne postoje evidentirani termini!"); } var search = new TerminRCSearchRequest() { KandidatId = kandidat[0].Id }; await model.PrikaziTermine(search); } catch (Exception ex) { await Application.Current.MainPage.DisplayAlert("Obavjestenje!", ex.Message, "OK"); } }
public async Task PrikaziTermine(TerminRCSearchRequest search) { //ukoliko je datum 1/1/2000 prikazuje sve termine var termini = await _termini.Get <List <MTerminRasporedaCasova> >(search); listaTermina.Clear(); foreach (var i in termini) { listaTermina.Add(i); } }
private async void btnKandidat_Click(object sender, EventArgs e) { _flpRasporedCasova.Controls.Clear(); var search = new TerminRCSearchRequest { KandidatId = KandidatId, Datum = _dtpDatumTermina.Value }; _flpRasporedCasova.Controls.Add(new HeaderRasporedCasova()); //trazenje rasporeda za kandidata koji je odabran var termini = await _terminRasporeda.Get <List <MTerminRasporedaCasova> >(search); FormirajTabelu(termini); }
protected async override void OnAppearing() { base.OnAppearing(); var searchKandidat = new KandidatSearchRequest() { KorisnikId = APIService.trenutniKorisnik.Id }; //pretraga kandidata sa tim korisnickim nalogom var kandidat = await _kandidati.Get <List <MKandidat> >(searchKandidat); if (kandidat.Count() != 0) { var searchPrakticno = new TerminRCSearchRequest() { KandidatId = kandidat[0].Id, Prakticno = true, PrikazUXamarinu = true }; var searchTeorija = new TerminRCSearchRequest() { KandidatId = kandidat[0].Id, Teorija = true, PrikazUXamarinu = true }; var searchZ = new ZahtjeviSearchRequest() { KandidatiId = kandidat[0].Id, PrikazUXamarinu = true }; await model.VratiBrojCasovaPrakticno(searchPrakticno); await model.VratiBrojCasovaTeorija(searchTeorija); await model.VratiInfoUsluga(searchZ); } else { await Application.Current.MainPage.DisplayAlert("Nema usluga!", "Nemate aktivnih usluga", "OK"); } }
public async Task VratiBrojCasovaTeorija(TerminRCSearchRequest search) { var termini = await _terminiRasporeda.Get <List <MTerminRasporedaCasova> >(search); BrojCasovaTeorija = termini.Count(); }