Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
UEngage/UEngage/Login.xaml.cs
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
70 lines (57 sloc)
1.79 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using UEngage.Models; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Xaml; | |
namespace UEngage | |
{ | |
[XamlCompilation(XamlCompilationOptions.Compile)] | |
public partial class Login : ContentPage | |
{ | |
public Login() | |
{ | |
InitializeComponent(); | |
} | |
private void btnsignup_Clicked(object sender, EventArgs e) | |
{ | |
Navigation.PushModalAsync(new Signup()); | |
} | |
private async void btnlogin_Clicked(object sender, EventArgs e) | |
{ | |
try | |
{ | |
if (!string.IsNullOrEmpty(txtusername.Text) || !string.IsNullOrEmpty(txtpassword.Text)) | |
{ | |
User_ user = App.Database.GetUserAsync(txtusername.Text).Result; | |
if (user.Password == txtpassword.Text) | |
{ | |
busyIndi.IsVisible = true; | |
await Task.Delay(1000); | |
Constant.loggedUser = user; | |
Application.Current.MainPage = new Tabbed(); | |
busyIndi.IsVisible = false; ; | |
} | |
else | |
{ | |
DisplayAlert("", "invalid username or password", "Ok"); | |
} | |
} | |
else | |
{ | |
DisplayAlert("", "invalid username or password", "Ok"); | |
} | |
} | |
catch (Exception) | |
{ | |
DisplayAlert("", "You dont have an account. Please signup", "Ok"); | |
return; | |
} | |
} | |
/*async void OnSignUpClicked(object sender, EventArgs e) | |
{ | |
}*/ | |
} | |
} |