public void Confirm()
        {
            if (SelectedAddressDataWrapper != null)
            {
                SelectedAddressDataWrapper.PropertyChanged -= AddressMapEditViewModel_PropertyChanged;
            }

            ThisWindow.DialogResult = true;
            ThisWindow.Close();
        }
Ejemplo n.º 2
0
        public void disconnect()
        {
            ThisWindow.Close();
            MainWindow x = new MainWindow();

            x.Show();
            MahApps.Metro.Controls.MetroWindow wd = Window.GetWindow(x) as MahApps.Metro.Controls.MetroWindow;
            if (wd != null)
            {
                wd.ShowMessageAsync("You were Disconnected ", " You were disconnected and sent back to login Window");
            }
        }
Ejemplo n.º 3
0
 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");
     }
 }