示例#1
0
        public static List <Activity> GetSpecificDateActivityLog(DateTimeOffset specificTime)
        {
            List <Activity> activityLog = new List <Activity>();

            using (var db = new MemoAppContext())
            {
                List <EachTask> eachTaskList = EachTaskModel.GetSpecificDateEachTasks(specificTime);

                foreach (var eachTask in eachTaskList)
                {
                    List <TimeInfo> timeInfoList = TimeInfoModel.GetSpecificTaskTimeInfo(eachTask.EachTaskId);

                    foreach (TimeInfo timeInfo in timeInfoList)
                    {
                        Activity activity = new Activity()
                        {
                            ExactStartTime = timeInfo.Start.LocalDateTime,
                            StartTime      = timeInfo.Start.LocalDateTime.ToString(" HH : mm "),
                            StopTime       = timeInfo.Stop == DateTimeOffset.MinValue ? " XX : XX " : timeInfo.Stop.LocalDateTime.ToString(" HH : mm "),
                            TaskContent    = eachTask.Content,
                            EachTaskId     = eachTask.EachTaskId
                        };

                        activityLog.Add(activity);
                    }
                }
            }

            return(activityLog.OrderBy(log => log.ExactStartTime).ToList());
        }
示例#2
0
        public static List <EachTask> GetSpecificDateEachTaskList(DateTimeOffset specificDatetime)
        {
            List <EachTask> eachTaskList = new List <EachTask>();

            eachTaskList.AddRange(EachTaskModel.GetSpecificDateEachTasks(specificDatetime));
            eachTaskList = AddAllTask(eachTaskList);

            return(eachTaskList);
        }
示例#3
0
        public static List <TaskDisplayInfo> GetTaskDisplayInfo()
        {
            List <EachTask> specificDateEachTaskList = EachTaskModel.GetSpecificDateEachTasks(DateTimeOffset.Now.LocalDateTime).ToList();

            List <TaskDisplayInfo> result = new List <TaskDisplayInfo>();

            specificDateEachTaskList.ForEach(eachTask =>
            {
                TaskDisplayInfo info = new TaskDisplayInfo
                {
                    EachTaskId = eachTask.EachTaskId,
                    Content    = (eachTask.CompleteFlag ? "✔" : "").PadRight(3) + eachTask.Content
                };
                result.Add(info);
            });

            return(result);
        }
示例#4
0
        public void SetTaskDisplayInfo()
        {
            try
            {
                List <EachTask> specificDateEachTaskList = EachTaskModel.GetSpecificDateEachTasks(this.MainDate).ToList();

                TaskListData.Clear();

                specificDateEachTaskList?.ForEach(eachTask =>
                {
                    TaskDisplayInfo info = new TaskDisplayInfo
                    {
                        EachTaskId = eachTask.EachTaskId,
                        Content    = (eachTask.CompleteFlag ? "✔" : "").PadRight(3) + eachTask.Content
                    };
                    TaskListData.Add(info);
                });
            }
            catch
            {
                CommonViewModel.NotifySystemMessage(GetLangMessage.GetMessage("Exception"));
            }
        }