コード例 #1
0
        public void ShorOtherDateLog()
        {
            TaskListData.Clear();

            List <EachTask> specificTaskList = GetSpecificDateEachTaskList(LogDate);

            specificTaskList.ForEach(eachTask => TaskListData.Add(eachTask));

            ActivityLog.Clear();
            ModelsHelpers.GetSpecificDateActivityLog(LogDate).ForEach(activity => ActivityLog.Add(activity));

            NoteList.Clear();
            ChangeMemoListToNoteList(MemoModel.GetSpecificDateMemo(LogDate)).ForEach(memo => NoteList.Add(memo));
        }
コード例 #2
0
        public void ShowSpecificTaskLog()
        {
            ActivityLog.Clear();
            List <Activity> SpecificDateActivityList = ModelsHelpers.GetSpecificDateActivityLog(LogDate);

            NoteList.Clear();
            List <Note> SpecificDateNote = ChangeMemoListToNoteList(MemoModel.GetSpecificDateMemo(LogDate));

            if (SelectedEachTaskId != null)
            {
                SpecificDateActivityList = SpecificDateActivityList.Where(activity => activity.EachTaskId == SelectedEachTaskId).ToList();
                SpecificDateNote         = SpecificDateNote.Where(note => note.EachTaskId == SelectedEachTaskId).ToList();
            }

            SpecificDateActivityList.ForEach(activity => ActivityLog.Add(activity));
            SpecificDateNote.ForEach(note => NoteList.Add(note));
        }
コード例 #3
0
        //Called if user selects "1" from main menu. Creates new activity object, records user inputs and adds to ActivitiesList
        private void LogActivity()
        {
            Activity activity     = new Activity();
            string   activityName = null;
            double   activityDuration;
            bool     validDuration = false;
            double   activityExcertion;
            bool     validExcertion;

            //checks that something is entered for activity name
            while (!ActivityNameIsValid(activityName))
            {
                System.Console.WriteLine("Please input the name of the activity.");
                activityName = Console.ReadLine();
            }

            activity.Name = activityName;

            //checks that a valid double value is entered for activity duration
            do
            {
                System.Console.WriteLine("How long (minutes) did you perform the activity?");
                string durationInput = Console.ReadLine();
                validDuration = double.TryParse(durationInput, out activityDuration);
            } while(!validDuration);

            activity.Duration = activityDuration;

            //checks that a valid double value is entered for activity excertion
            do
            {
                System.Console.WriteLine("What was your percieved exertion (1-10)?");
                string excertionInput = Console.ReadLine();
                validExcertion = double.TryParse(excertionInput, out activityExcertion);
            } while(!validExcertion);

            activity.PerceivedExertion = activityExcertion;

            activity.timeStamp = DateTime.Now;
            activityLog.Add(activity);
            activity.SummarizeEntry();
        }
コード例 #4
0
ファイル: LogPageViewModel.cs プロジェクト: TiraTom/TaskOK
        public void ShowSpecificTaskLog()
        {
            try
            {
                ActivityLog.Clear();
                List <Activity> SpecificDateActivityList = ModelsHelpers.GetSpecificDateActivityLog(LogDate);
                NoteList.Clear();
                List <Note> SpecificDateNote = ChangeMemoListToNoteList(MemoModel.GetSpecificDateMemo(LogDate));

                if (SelectedEachTaskId != null)
                {
                    SpecificDateActivityList = SpecificDateActivityList.Where(activity => activity.EachTaskId == SelectedEachTaskId).ToList();
                    SpecificDateNote         = SpecificDateNote.Where(note => note.EachTaskId == SelectedEachTaskId).ToList();
                }

                SpecificDateActivityList.ForEach(activity => ActivityLog.Add(activity));
                SpecificDateNote.ForEach(note => NoteList.Add(note));
            }
            catch
            {
                CommonViewModel.NotifySystemMessage(GetLangMessage.GetMessage("Exception"));
            }
        }
コード例 #5
0
ファイル: LogPageViewModel.cs プロジェクト: TiraTom/TaskOK
        public void ShorOtherDateLog()
        {
            try
            {
                TaskListData.Clear();

                List <EachTask> specificTaskList = GetSpecificDateEachTaskList(LogDate);
                specificTaskList.ForEach(eachTask => TaskListData.Add(eachTask));

                ActivityLog.Clear();
                ModelsHelpers.GetSpecificDateActivityLog(LogDate).ForEach(activity => ActivityLog.Add(activity));

                NoteList.Clear();
                ChangeMemoListToNoteList(MemoModel.GetSpecificDateMemo(LogDate)).ForEach(memo => NoteList.Add(memo));
            }
            catch
            {
                CommonViewModel.NotifySystemMessage(GetLangMessage.GetMessage("Exception"));
            }
        }