Exemplo n.º 1
0
 private void AddExcerciseToPlan(Excercise e)
 {
     try
     {
         Excercises.Add(e);
     }
     catch (Exception ex)
     {
         Application.Current.MainPage.DisplayAlert("Alert", ex.Message, "ok");
     }
 }
Exemplo n.º 2
0
        public override void Init(object initData)
        {
            var data = initData as dynamic;

            TodaysPlan          = data.plan;
            TodaysTraining.Date = data.date;

            foreach (var item in TodaysPlan.Excercises)
            {
                Excercises.Add(item);
            }
            TodaysTraining.Plan = TodaysPlan.PlanName;
        }
Exemplo n.º 3
0
        public void Add(Activity activity, DateTime start, DateTime end)
        {
            var act = Activities.SingleOrDefault(a => a.Name == activity.Name);

            if (act == null)
            {
                Activities.Add(activity);
                var excercise = new Excercise(start, end, activity, User);
                Excercises.Add(excercise);
            }
            else
            {
                var excercise = new Excercise(start, end, act, User);
                Excercises.Add(excercise);
            }

            Save();
        }