Skip to content
Permalink
master
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
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)
{
}*/
}
}