Пример #1
0
 public AllImportantDatesViewModel(ImportantDatesLogic importantDatesLogic)
 {
     Condition = "Visible";
     this.importantDatesLogic = importantDatesLogic;
     calendar    = new Calendar();
     SelectedDay = new RelayCommand <int>(ViewEvents);
     Months      = new List <string>()
     {
         "Январь",
         "Февраль",
         "Март",
         "Апрель",
         "Май",
         "Июнь",
         "Июль",
         "Август",
         "Сентябрь",
         "Октябрь",
         "Ноябрь",
         "Декабрь"
     };
     Years = new LinkedList <int>();
     for (int i = 1900; i <= 2328; i++)
     {
         Years.AddLast(i);
     }
     selectedMonth = calendar.GetMonthNow();
     selectedYear  = Convert.ToInt32(DateTime.Now.ToString("yyyy"));
     pastSelect    = 0;
     StandardActions(Convert.ToInt32(DateTime.Now.ToString("dd")));
     dispatcher = Dispatcher.CurrentDispatcher;
     IsClose    = false;
 }
Пример #2
0
 public MyNotesViewModel(NotesLogic notesLogic, ImportantDatesLogic importantDatesLogic, BasketLogic basketLogic)
 {
     this.notesLogic          = notesLogic;
     this.importantDatesLogic = importantDatesLogic;
     this.basketLogic         = basketLogic;
     NotesLogic          = this.notesLogic;
     ImportantDatesLogic = this.importantDatesLogic;
 }
Пример #3
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());
     });
 }
Пример #4
0
        public NewImportantDateViewModel(ImportantDatesLogic importantDatesLogic, int numberOfDay, string month, int year)
        {
            this.importantDatesLogic = importantDatesLogic;
            Overall();
            selectedMonth = month;
            selectedYear  = year;
            int count = day.GetNumberOfDaysInThisMonth(month, year);

            for (int i = 1; i <= count; i++)
            {
                Days.Add(i);
            }
            SelectedDay = numberOfDay;
            editId      = -1;
        }
Пример #5
0
        public NewImportantDateViewModel(ImportantDatesLogic importantDatesLogic)
        {
            this.importantDatesLogic = importantDatesLogic;
            Overall();
            selectedMonth = day.GetMonthNow();
            selectedYear  = Convert.ToInt32(DateTime.Now.ToString("yyyy"));
            int count = day.GetNumberOfDaysInThisMonth(selectedMonth, selectedYear);

            for (int i = 1; i <= count; i++)
            {
                Days.Add(i);
            }
            SelectedDay = Convert.ToInt32(DateTime.Now.ToString("dd"));
            editId      = -1;
        }
Пример #6
0
        public NewImportantDateViewModel(ImportantDatesLogic importantDatesLogic, int numberOfDay, string month, int year, string eventText, int annually)
        {
            this.importantDatesLogic = importantDatesLogic;
            Overall();
            selectedMonth = month;
            selectedYear  = year;
            int count = day.GetNumberOfDaysInThisMonth(month, year);

            for (int i = 1; i <= count; i++)
            {
                Days.Add(i);
            }
            SelectedDay = numberOfDay;
            Text        = eventText;
            if (annually == 1)
            {
                IsAnnually = true;
            }
            else
            {
                IsAnnually = false;
            }
            editId = importantDatesLogic.GetIdByEventAndDate(Text, ZeroOrNull() + SelectedDay.ToString() + "." + day.GetNumberOfMonth(SelectedMonth) + "." + SelectedYear.ToString());
        }