private void PozoviApiFunkciju() { ClientLoginDto clog = new ClientLoginDto { KIme_Mail = FindViewById <TextView>(Resource.Id.usernameText).Text, Sifra = FindViewById <TextView>(Resource.Id.passwordText).Text }; try { SesijaDto sesija = Api.Api.LoginUser(clog); MSettings.CurrentSession = new Session() { SessionID = sesija.IdSesije }; KorisnikFullDto korisnik = Api.Api.GetUserFullInfo(sesija.IdKorisnika); if (korisnik.IdTipaNaloga == (int)User.UserAccountType.Student) { //if (!Api.LogoutUser(MSettings.CurrentSession.SessionID)) // throw new Exception("Neuspesno ciscenje logovanja"); var intent = new Intent(this, typeof(MainSwipePage)); intent.AddFlags(ActivityFlags.ClearTop | ActivityFlags.NewTask); StartActivity(intent); alert.Dismiss(); MSettings.CurrentSession.LoggedUser = MUtility.User_From_KorisnikFullDto(korisnik); if (check.Checked) { ZapamtiKorisnika(clog.KIme_Mail, clog.Sifra); } this.Finish(); } else { alert.Dismiss(); MSettings.CurrentSession = null; //Toast.MakeText(this, "Ovo nije korisnicki nalog!", ToastLength.Short).Show(); RunOnUiThread(() => Toast.MakeText(this, "Ovo nije korisnicki nalog!", ToastLength.Short).Show()); } } catch (Exception ex) { alert.Dismiss(); MSettings.CurrentSession = null; //Toast.MakeText(this, ex.Message, ToastLength.Short).Show(); RunOnUiThread(() => Toast.MakeText(this, "Nepravilno korisnicko ime ili lozinka!", ToastLength.Short).Show()); } }