|
|
|
@ -1,8 +1,8 @@
|
|
|
|
|
//using Microsoft.UI.Xaml.Navigation;
|
|
|
|
|
using Model;
|
|
|
|
|
using static System.Runtime.InteropServices.JavaScript.JSType;
|
|
|
|
|
|
|
|
|
|
namespace Stim;
|
|
|
|
|
|
|
|
|
|
public partial class LoginPage : ContentPage
|
|
|
|
|
{
|
|
|
|
|
public LoginPage()
|
|
|
|
@ -12,29 +12,28 @@ public partial class LoginPage : ContentPage
|
|
|
|
|
|
|
|
|
|
private async void Se_connecter(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(Username.Text) || !string.IsNullOrWhiteSpace(Pswd.Text))
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(Username.Text) && !string.IsNullOrWhiteSpace(Pswd.Text))
|
|
|
|
|
{
|
|
|
|
|
User user = ((App)App.Current).Manager.SearchUser(Username.Text);
|
|
|
|
|
if (user != null)
|
|
|
|
|
{
|
|
|
|
|
if (user.Password == Pswd.Text)
|
|
|
|
|
{
|
|
|
|
|
((App)App.Current).Manager.CurrentUser = user;
|
|
|
|
|
if (user != null)
|
|
|
|
|
{
|
|
|
|
|
if (user.Password == Pswd.Text)
|
|
|
|
|
{
|
|
|
|
|
((App)App.Current).Manager.CurrentUser = user;
|
|
|
|
|
Application.Current.MainPage = new AppShell();
|
|
|
|
|
await Shell.Current.GoToAsync("//MainPage");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
else Error.Children.Add(new Label { Text = "Mot de passe incorrect", TextColor = Colors.Red, VerticalTextAlignment = TextAlignment.Start });
|
|
|
|
|
}
|
|
|
|
|
else Error.Children.Add(new Label { Text = "Information incorrecte", TextColor = Colors.Red, VerticalTextAlignment = TextAlignment.Start });
|
|
|
|
|
}
|
|
|
|
|
else Error.Children.Add(new Label { Text = "Champs vides", TextColor = Colors.Red, VerticalTextAlignment = TextAlignment.Start });
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async void Creer_un_compte(object sender, EventArgs e)
|
|
|
|
|
private void Creer_un_compte(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
await Shell.Current.GoToAsync("//MainPage");
|
|
|
|
|
Application.Current.MainPage = new Create();
|
|
|
|
|
}
|
|
|
|
|
}
|