Ejemplo n.º 1
0
        private void tbPublish_Click(object sender, EventArgs e)
        {
            if (TrainingPlan == null)
            {
                return;
            }
            PublishWorkoutPlanWindow dlg = new PublishWorkoutPlanWindow();

            dlg.Fill(TrainingPlan, true);
            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                ObjectsReposidory.ClearWorkoutPlansCache();
                Fill();
            }
        }
        public static bool AddToFavorites(this WorkoutPlanDTO plan)
        {
            if (plan == null || plan.IsFavorite() || plan.IsMine())
            {
                return(false);
            }
            PublishWorkoutPlanWindow dlg = new PublishWorkoutPlanWindow();

            dlg.Fill(plan, false);
            if (dlg.ShowDialog() == DialogResult.Cancel)
            {
                return(false);
            }
            ObjectsReposidory.ClearWorkoutPlansCache();
            return(true);
        }