Пример #1
0
        private void cmdCalculate_Click(object sender, EventArgs e)
        {
            if (!IsValidInput())
            {
                _mboxService.ShowErrorMessageBox(
                    "Please make sure to select a stardust to craft and amount is a valid number.");
                return;
            }

            lblRequirements.Text = GetRequirements();
        }
Пример #2
0
        private bool IsValidInput()
        {
            if (!IsValidStartingGemLevel())
            {
                _msgBoxService.ShowErrorMessageBox("Please select a starting gem level", "Select starting gem level");
                return(false);
            }

            if (!IsValidTargetGemLevel())
            {
                _msgBoxService.ShowErrorMessageBox("Please select a target gem level", "Select target gem level");
                return(false);
            }

            if (!IsValidCalculation())
            {
                _msgBoxService.ShowErrorMessageBox("Starting gem level must be less than target gem level",
                                                   "Invalid input");
                return(false);
            }

            return(true);
        }
Пример #3
0
        public void Save()
        {
            if (name == null)
            {
                MessageBoxService.ShowErrorMessageBox(new Exception("Invalid team name"));
            }

            else
            {
                //TODO Save
                MessageBoxService.ShowMessageBox("Nastavení týmu bylo aktualizováno.", "Uloženo.");
                GoBack();
            }
        }
Пример #4
0
        public void Login()
        {
            var    user            = AppRepository.UsersRepository.FindUserByEmail(Email);
            string encodedPassword = Password; //TODO Encode password

            if (user == null)
            {
                MessageBoxService.ShowErrorMessageBox(new Exception("Invalid user"));
            }
            else if (encodedPassword != user.Password)
            {
                MessageBoxService.ShowMessageBox("Invalid password");
            }
            else
            {
                AppRepository.UsersRepository.UpdateLastLogin(user.ID, DateTime.Now);

                var model = IoC.Get <MainPageViewModel>();
                EventAggregator.PublishOnUIThread(new ShowViewModelMessage(model));
            }
        }