Example #1
0
        private async void BtnLogin_OnClicked(object sender, EventArgs e)
        {
            string username = CBYear.SelectedItem.ToString() + CBProgram.SelectedItem.ToString() +
                              EntryRollNo.Text.Trim();

            BtnLogin.IsEnabled = false;

            var student = await _studentController
                          .Authenticate(
                new AuthenticationModel()
            {
                Password = entryPassword.Text, Username = username
            }
                );


            if (student == null)
            {
                await DisplayAlert("Unable to login!", "Authentication Error", "Ok");

                BtnLogin.IsEnabled = true;
                return;
            }
            Application.Current.MainPage = new NavigationPage(new MainView.MainView());
        }