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()); }
public static List <EachTask> GetSpecificDateEachTaskList(DateTimeOffset specificDatetime) { List <EachTask> eachTaskList = new List <EachTask>(); eachTaskList.AddRange(EachTaskModel.GetSpecificDateEachTasks(specificDatetime)); eachTaskList = AddAllTask(eachTaskList); return(eachTaskList); }
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); }
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")); } }