Exemplo n.º 1
0
 public NewGoalViewModel(GoalsLogic goalsLogic)
 {
     this.goalsLogic = goalsLogic;
     Condition       = "Visible";
     TitleGoal       = "";
     DescriptionGoal = "";
     BackgroundTitle = (Brush) new BrushConverter().ConvertFromString("White");
 }
Exemplo n.º 2
0
        void AddGoal()
        {
            GoalsLogic goalsLogic = new GoalsLogic();

            goalsLogic.AddGoal(User, Goals);

            (App.Current as App).NavigationCommand.Execute("Dashboard");
        }
Exemplo n.º 3
0
 public PlannerViewModel(TimetableForTheDaysLogic timetableForTheDaysLogic, HabitsTrackerLogic habitsTrackerLogic, GoalsLogic goalsLogic)
 {
     this.timetableForTheDaysLogic = timetableForTheDaysLogic;
     TimetableForTheDaysLogic      = this.timetableForTheDaysLogic;
     this.habitsTrackerLogic       = habitsTrackerLogic;
     HabitsTrackerLogic            = this.habitsTrackerLogic;
     this.goalsLogic = goalsLogic;
     GoalsLogic      = this.goalsLogic;
 }
Exemplo n.º 4
0
 public AllGoalsViewModel(GoalsLogic goalsLogic)
 {
     this.goalsLogic = goalsLogic;
     Condition       = "Visible";
     Goals           = new ObservableCollection <Goal>(this.goalsLogic.GetAllGoals());
     EditAndViewGoal = new RelayCommand <int>(EditViewGoal);
     GoalCheck       = new RelayCommand <int>(Check);
     DeleteGoal      = new RelayCommand <int>(Delete);
     Count           = Goals.Count;
 }
Exemplo n.º 5
0
 public EditGoalViewModel(GoalsLogic goalsLogic, int id, string text, string description)
 {
     this.goalsLogic = goalsLogic;
     GoalsLogic      = this.goalsLogic;
     Condition       = "Visible";
     TitleGoal       = text;
     DescriptionGoal = description;
     this.id         = id;
     BackgroundTitle = (Brush) new BrushConverter().ConvertFromString("White");
     Status          = "Закрытие";
 }
Exemplo n.º 6
0
 private async void CreateLogicAsync()
 {
     await Task.Run(() =>
     {
         notesLogic               = new NotesLogic(diaryLogic.GetDataBase());
         importantDatesLogic      = new ImportantDatesLogic(diaryLogic.GetDataBase());
         timetableForTheDaysLogic = new TimetableForTheDaysLogic(diaryLogic.GetDataBase());
         habitsTrackerLogic       = new HabitsTrackerLogic();
         goalsLogic               = new GoalsLogic(diaryLogic.GetDataBase());
         basketLogic              = new BasketLogic(diaryLogic.GetDataBase());
     });
 }
Exemplo n.º 7
0
        public void Refresh()
        {
            GoalsLogic goalsLogic = new GoalsLogic();

            Goals = goalsLogic.GetGoals(User, DateTime.Today);

            if (Goals != null)
            {
                FoodLogic foodLogic = new FoodLogic();
                var       meals     = foodLogic.GetMeals(User, Goals.GoalStartDate, Goals.GoalEndDate);
                Weekly = foodLogic.GetTotals(meals);
            }
        }
Exemplo n.º 8
0
 private async void WaitingEdit()
 {
     await Task.Run(() =>
     {
         while (IsClose != true && editGoalViewModel.Condition != "Collapsed")
         {
         }
         if (editGoalViewModel.Status == "Сохранение и закрытие")
         {
             goalsLogic = editGoalViewModel.GoalsLogic;
             Goals      = new ObservableCollection <Goal>(this.goalsLogic.GetAllGoals());
         }
     });
 }