示例#1
0
        private void GoToBacklogCommandExecute(Window window)
        {
            BacklogVM dataContext = new BacklogVM(logedUser, _dialogCoordinator); // mozna by przekazywac ta wczesniej uzywana klase by parametry wyszukiwania zostawaly
            Backlog   backlog     = new Backlog();

            backlog.DataContext = dataContext;
            backlog.Show();
            window.Close();
        }
示例#2
0
        private async void OkCommandExecute(Window window)
        {
            if (loginMode)
            {
                int log = repo.UsersRepo.UserLogin(Login, passwordCopy);
                if (log == 1)
                {
                    BacklogVM dataContext = new BacklogVM(repo.UsersRepo.GetUserByName(login), _dialogCoordinator);
                    Backlog   backlog     = new Backlog();
                    backlog.DataContext = dataContext;
                    backlog.Show();
                    window.Close();
                }
                else if (log == 0)
                {
                    var metroWindow = (Application.Current.MainWindow as MetroWindow);
                    await metroWindow.ShowMessageAsync("Ups!", "Użytkownik nie istnieje");

                    ClearTextBoxes();
                }
                else
                {
                    var metroWindow = (Application.Current.MainWindow as MetroWindow);
                    await metroWindow.ShowMessageAsync("Ups!", "Błędne hasło");

                    ClearTextBoxes();
                }
            }
            else
            {
                if (repo.UsersRepo.RegisterUser(Login, passwordCopy))
                {
                    var metroWindow = (Application.Current.MainWindow as MetroWindow);
                    await metroWindow.ShowMessageAsync("Super!", "Zarejestrowano");

                    RegisterCommandExecute();
                }
                else
                {
                    var metroWindow = (Application.Current.MainWindow as MetroWindow);
                    await metroWindow.ShowMessageAsync("Ups!", "Nick jest zajęty");

                    ClearTextBoxes();
                }
            }
        }