public void ShowCustomer()
        {
            ClientView clientView = new ClientView();

            clientView.Show();
            CloseMainMenu();
        }
 private void GoBack()
 {
     if (prevIsMain)
     {
         MainMenuView main = new MainMenuView();
         main.Show();
     }
     else
     {
         ClientView client = new ClientView();
         client.Show();
     }
     CloseSelf();
 }
예제 #3
0
        private void Login()
        {
            if (Validators.ValidateEmail(User.Email) && Validators.ValidatePassword(User.Password))
            {
                UserDAL userDAL    = new UserDAL();
                User    loggedUser = userDAL.Login(User);
                if (loggedUser != null)
                {
                    switch (loggedUser.UserType)
                    {
                    case UserType.Client:
                        ClientView clientView = new ClientView();
                        (clientView.DataContext as ClientViewModel).User = loggedUser;
                        clientView.Show();
                        break;

                    case UserType.Employee:
                        EmployeeView employeeView = new EmployeeView();
                        (employeeView.DataContext as EmployeeViewModel).User = loggedUser;
                        employeeView.Show();
                        break;

                    case UserType.Admin:
                        AdminView adminView = new AdminView();

                        adminView.Show();
                        break;

                    default:
                        break;
                    }
                    Application.Current.MainWindow.Close();
                }
                else
                {
                    UserDialog.MessageDialog(message: "Login failed!", type: DialogType.Alert);
                }
            }
        }