Beispiel #1
0
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            acceuil x = new acceuil(Role);

            x.Show();
            this.Close();
        }
Beispiel #2
0
        private void Home_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
            acceuil x = new acceuil(Role);

            x.Show();
        }
 public void connect()
 {
     if (pass != null && name != null)
     {
         UserSet USER = new UserSet();
         USER = ctx.UserSets.SingleOrDefault(u => u.login == name);
         if (USER != null)
         {
             if (USER.password == pass && (Roles(USER) == 1 || Roles(USER) == 2 || Roles(USER) == 3))
             {
                 acceuil acceuil = new acceuil(USER.profile);
                 acceuil.Show();
                 ThisWindow.Close();
                 MahApps.Metro.Controls.MetroWindow window = Window.GetWindow(acceuil) as MahApps.Metro.Controls.MetroWindow;
                 if (window != null)
                 {
                     DateTime dt = DateTime.Today;
                     string   mt = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(dt.Month);
                     window.ShowMessageAsync("Hello " + USER.login, "It is ' " + dt.DayOfWeek + " the " + dt.Day + " of " + mt + " '. ");
                 }
             }
             else
             {
                 MessageBox.Show("Wrong Pass! Please verify");
             }
         }
         else
         {
             MessageBox.Show("User Doesn't Exist ! Please verify");
         }
     }
     else
     {
         MessageBox.Show("Wrong UserName! Please verify");
     }
 }