public override void RefreshView() { if (IsModified && BAMessageBox.AskWarningYesNo("Message_RefreshView_ModifiedDay".TranslateStrings()) == MessageBoxResult.No) { return; } if (!ReadOnly) { day = TrainingDayPageContext.Day.StandardClone(); } Fill(); SetModifiedFlag(); }
private void btnDeleteProfile_Click(object sender, EventArgs e) { if (BAMessageBox.AskWarningYesNo(Strings.QDeleteProfile) == MessageBoxResult.Yes) { PleaseWait.Run(delegate { var profileOperation = new ProfileOperationParam(); profileOperation.ProfileId = UserContext.Current.CurrentProfile.GlobalId; profileOperation.Operation = ProfileOperation.Delete; ServiceManager.ProfileOperation(profileOperation); ProfileDeleted = true; }); UserContext.Current.Logout(skipLogoutOnServer: true); } }
void changeAccountType(AccountType accountType) { if (UserContext.Current.ProfileInformation.Licence.AccountType > accountType) { int accountDiff = accountType - UserContext.Current.ProfileInformation.Licence.AccountType; int kara = Math.Abs(accountDiff) * UserContext.Current.ProfileInformation.Licence.Payments.Kara; if (BAMessageBox.AskWarningYesNo(EnumLocalizer.Default.GetGUIString("ChangeAccountTypeView_QLowerAccountType"), kara) == MessageBoxResult.No) { return; } } else { if (BAMessageBox.AskYesNo(EnumLocalizer.Default.GetGUIString("ChangeAccountTypeView_QUpAccountType")) == MessageBoxResult.No) { return; } } PleaseWait.Run((x) => { try { var param = new ProfileOperationParam(); param.Operation = ProfileOperation.AccountType; param.ProfileId = UserContext.Current.CurrentProfile.GlobalId; param.AccountType = accountType; ServiceManager.ProfileOperation(param); UserContext.Current.RefreshUserData(); Scheduler.Ensure(); } catch (ConsistencyException ex) { x.CloseProgressWindow(); Dispatcher.Invoke(new Action(() => ExceptionHandler.Default.Process(ex, EnumLocalizer.Default.GetGUIString("ChangeAccountTypeView_ErrEnoughtBAPoints"), ErrorWindow.MessageBox))); } catch (Exception ex) { x.CloseProgressWindow(); Dispatcher.Invoke(new Action(() => ExceptionHandler.Default.Process(ex, EnumLocalizer.Default.GetGUIString("ChangeAccountTypeView_ErrDuringChangeAccountType"), ErrorWindow.EMailReport))); } }, false, MainWindow.Instance); }
public bool ValidateControl() { var incorrectSets = SerieValidator.GetIncorrectSets(StrengthTrainingEntry); if (incorrectSets.Count > 0) { StringBuilder builder = new StringBuilder(); builder.AppendLine("usrStrengthTraining_MsgIncorrectSetsValidation".TranslateStrength()); foreach (var incorrectSet in incorrectSets.GroupBy(x => x.StrengthTrainingItem.Exercise)) { builder.Append(incorrectSet.Key.GetLocalizedName() + ": "); foreach (var serieDto in incorrectSet) { builder.Append(serieDto.GetDisplayText(WorkoutPlanOperationHelper.SetDisplayMode.Medium) + ", "); } builder.AppendLine(); } if (BAMessageBox.AskWarningYesNo(builder.ToString()) == MessageBoxResult.No) { return(false); } } return(true); }