You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
MapManga/MangaMap/Views/settingsPage.xaml.cs

34 lines
965 B

namespace MangaMap.Views;
using Model;
public partial class settingsPage : ContentPage
{
public Manager my_manager => (App.Current as App).MyManager;
public settingsPage()
{
InitializeComponent();
}
private async void OnDisconnectClicked(object sender, EventArgs e)
{
my_manager.UtilisateurActuel = new Utilisateur();
my_manager.isAdmin = false;
await Shell.Current.GoToAsync("//page/secondaire/connexionPage");
}
private async void LoginAdminClicked(object sender, EventArgs e)
{
await Shell.Current.Navigation.PushAsync(new loginAdminPage());
}
private async void AddClicked(object sender, EventArgs e)
{
if(my_manager.isAdmin)
{
await Shell.Current.Navigation.PushAsync(new createOeuvre());
}
await DisplayAlert("Erreur", "Vous n'êtes pas connecté en tant qu'Administrateur.", "OK");
return;
}
}