Exemplo n.º 1
0
 private void lsItems_ListReordering(object sender, System.ComponentModel.CancelEventArgs e)
 {
     if (!UpgradeAccountControl.EnsureAccountType(ApplicationStrings.Feature_Premium_MoreFeatures, this))
     {
         e.Cancel = true;
     }
 }
Exemplo n.º 2
0
 private void mnuShowProgress_Click(object sender, EventArgs e)
 {
     if (!UpgradeAccountControl.EnsureAccountType(ApplicationStrings.Feature_Premium_Reports, this))
     {
         return;
     }
     this.Navigate("/Pages/ExercisesWeightReportPage.xaml");
 }
Exemplo n.º 3
0
 void mnuTimer_Click(object sender, EventArgs e)
 {
     if (!UpgradeAccountControl.EnsureAccountType(ApplicationStrings.Feature_Premium_StrengthTrainingTimer, this))
     {
         return;
     }
     startTimer(!ApplicationState.Current.IsTimerEnabled);
 }
Exemplo n.º 4
0
 private void btnBodyInstructor_Click(object sender, RoutedEventArgs e)
 {
     if (!UpgradeAccountControl.EnsureAccountType(ApplicationStrings.Feature_Instructor_InstructorPart, this, AccountType.Instructor))
     {
         return;
     }
     NavigationService.Navigate(new Uri("/Pages/BodyInstructorPage.xaml", UriKind.RelativeOrAbsolute));
 }
 void mnuShowProgress_Click(object sender, EventArgs e)
 {
     if (!UpgradeAccountControl.EnsureAccountType(ApplicationStrings.Feature_Premium_Reports, this))
     {
         return;
     }
     if (isModified() && BAMessageBox.Ask(ApplicationStrings.StrengthWorkoutPage_QShowProgressForModifiedEntry) == MessageBoxResult.Cancel)
     {
         return;
     }
     this.Navigate("/Pages/MeasurementsReportPage.xaml");
 }
Exemplo n.º 6
0
 private void MainCalendar_OnDateClicked(object sender, WPControls.SelectionChangedEventArgs e)
 {
     selectedDate = e.SelectedDate;
     if (selectedDate.IsFuture() && !UpgradeAccountControl.EnsureAccountType(ApplicationStrings.Feature_Premium_AddEntriesInFuture, this))
     {
         return;
     }
     if (ApplicationState.Current.CurrentBrowsingTrainingDays.IsMine || ApplicationState.Current.CurrentBrowsingTrainingDays.TrainingDays.ContainsKey(selectedDate))
     {
         this.Navigate("/Pages/TrainingDayEntrySelectorPage.xaml");
     }
 }
        private void btnAddToFavorites_Click(object sender, EventArgs e)
        {
            if (!UpgradeAccountControl.EnsureAccountType(ApplicationStrings.Feature_Premium_CreatingWorkoutPlans, this))
            {
                return;
            }
            progressBar.ShowProgress(true);
            var m = new ServiceManager <WorkoutPlanOperationCompletedEventArgs>(delegate(BodyArchitectAccessServiceClient client1, EventHandler <WorkoutPlanOperationCompletedEventArgs> operationCompleted)
            {
                var param           = new WorkoutPlanOperationParam();
                param.WorkoutPlanId = SelectedPlan.GlobalId;
                param.Operation     = SupplementsCycleDefinitionOperation.AddToFavorites;
                client1.WorkoutPlanOperationAsync(ApplicationState.Current.SessionData.Token, param);
                client1.WorkoutPlanOperationCompleted -= operationCompleted;
                client1.WorkoutPlanOperationCompleted += operationCompleted;
            });

            m.OperationCompleted += (s1, a1) =>
            {
                progressBar.ShowProgress(false);
                FaultException <BAServiceException> serviceEx = a1.Error as FaultException <BAServiceException>;
                if (serviceEx != null && serviceEx.Detail.ErrorCode == ErrorCode.LicenceException)
                {
                    BAMessageBox.ShowInfo(ApplicationStrings.ErrLicence);
                    return;
                }
                if (a1.Error != null)
                {
                    BAMessageBox.ShowError(ApplicationStrings.ErrCannotAddPlanToFavorites);
                    return;
                }
                else
                {
                    ApplicationState.Current.Cache.TrainingPlans.Items.Add(SelectedPlan.GlobalId, SelectedPlan);
                }
                updateApplicationBar();
            };

            if (!m.Run())
            {
                progressBar.ShowProgress(false);
                if (ApplicationState.Current.IsOffline)
                {
                    BAMessageBox.ShowError(ApplicationStrings.ErrOfflineMode);
                }
                else
                {
                    BAMessageBox.ShowError(ApplicationStrings.ErrNoNetwork);
                }
            }
        }
        private void btnCopySelectedOldItems_Click(object sender, EventArgs e)
        {
            if (!UpgradeAccountControl.EnsureAccountType(ApplicationStrings.Feature_Premium_CopyAllExercisesToNewTraining, this))
            {
                return;
            }


            if (oldEntry != null)
            {
                copyAllImplementation(oldEntry);
                pivot.SelectedIndex            = 0;
                previewList.IsSelectionEnabled = false;
            }
        }
Exemplo n.º 9
0
 private void btnStartTimer_Click(object sender, RoutedEventArgs e)
 {
     if (!UpgradeAccountControl.EnsureAccountType(ApplicationStrings.Feature_Premium_StrengthTrainingTimer, this))
     {
         return;
     }
     //after click we disable the button for one second to prevent accidential clicking second time
     buttonClickTime    = DateTime.Now;
     btnStart.IsEnabled = false;
     timePicker.Focus();
     if (timer.IsEnabled)
     {
         StopTimer(true);
     }
     else
     {
         StartTimer(true);
     }
 }
 private void btnMyPlacesHelp_Click(object sender, System.Windows.RoutedEventArgs e)
 {
     UpgradeAccountControl.EnsureAccountType(ApplicationStrings.Feature_Premium_MyPlaces, this);
 }
Exemplo n.º 11
0
 private void btnEquipmentHelp_Click(object sender, RoutedEventArgs e)
 {
     UpgradeAccountControl.EnsureAccountType(ApplicationStrings.Feature_Premium_Equipments, this);
 }
Exemplo n.º 12
0
 private void btnMeasurementsPrivacyHelp_Click(object sender, RoutedEventArgs e)
 {
     UpgradeAccountControl.EnsureAccountType(ApplicationStrings.Feature_Premium_PrivateCalendar, this);
 }
Exemplo n.º 13
0
        private void btnRemoveAdds_Click(object sender, System.Windows.Input.GestureEventArgs e)
        {
            var currentPage = RootFrame.Content as PhoneApplicationPage;

            UpgradeAccountControl.EnsureAccountType(ApplicationStrings.Feature_Premium_NoAds, (DependencyObject)currentPage);
        }