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 void TaskPause(object sender, RoutedEventArgs e) { try { if (IsEachTaskIdEmpty()) { CommonViewModel.NotifySystemMessage(GetLangMessage.GetMessage("Msg1001")); return; } Msg = TimeInfoModel.RegisterPause(SelectedEachTaskId); if (Msg != null) { CommonViewModel.NotifySystemMessage(Msg); return; } if (NotifyRestTime != null) { NotifyRestTime.Cancel(); } CommonViewModel.RecentSelectedEachTaskId = SelectedEachTaskId; // Update Recent status SetRecentInfo("Msg1011"); } catch { CommonViewModel.NotifySystemMessage(GetLangMessage.GetMessage("Exception")); } }
public void TaskStart(object sender, RoutedEventArgs e) { try { if (IsEachTaskIdEmpty()) { CommonViewModel.NotifySystemMessage(GetLangMessage.GetMessage("Msg1001")); return; } Msg = TimeInfoModel.RegisterStart(SelectedEachTaskId); if (Msg != null) { CommonViewModel.NotifySystemMessage(Msg); if (Msg != GetLangMessage.GetMessage("Msg1016")) { // If the button pushing is invalid, return and not update the status. return; } } if (ConfigModel.GetSpecificConfigValue(ConfigModel.ConfigType.NotificationFlag) == true.ToString()) { this.NotifyRestTime = ThreadPoolTimer.CreatePeriodicTimer((source) => { Notification notification = new Notification(); notification.NotifyRestTime(); }, TimeSpan.FromMinutes(float.Parse(ConfigModel.GetSpecificConfigValue(ConfigModel.ConfigType.NotificationSpanMinute)))); } // Update Recent status SetRecentInfo("Msg1010"); } catch { CommonViewModel.NotifySystemMessage(GetLangMessage.GetMessage("Exception")); } }
public void TaskStop(object sender, RoutedEventArgs e) { if (IsEachTaskIdEmpty()) { NotifySystemMessage("タスクを選択してください"); return; } Msg = TimeInfoModel.RegisterStop(SelectedEachTaskId); if (Msg != null) { NotifySystemMessage(Msg); } if (NotifyRestTime != null) { NotifyRestTime.Cancel(); } CommonViewModel.RecentSelectedEachTaskId = SelectedEachTaskId; SetRecentInfo("完了済"); }
public void TaskStart(object sender, RoutedEventArgs e) { if (IsEachTaskIdEmpty()) { NotifySystemMessage("タスクを選択してください"); return; } Msg = TimeInfoModel.RegisterStart(SelectedEachTaskId); if (Msg != null) { NotifySystemMessage(Msg); } NotifyRestTime = ThreadPoolTimer.CreatePeriodicTimer((source) => { Notification notification = new Notification(); notification.NotifyRestTime(); }, TimeSpan.FromMinutes(float.Parse(ConfigModel.GetSpecificConfigValue(ConfigModel.ConfigType.NotificationSpanMinute)))); SetRecentInfo("実行中"); }
public void TaskStop(object sender, RoutedEventArgs e) { try { if (IsEachTaskIdEmpty()) { CommonViewModel.NotifySystemMessage(GetLangMessage.GetMessage("Msg1001")); return; } Msg = TimeInfoModel.RegisterStop(SelectedEachTaskId); if (Msg != null) { CommonViewModel.NotifySystemMessage(Msg); if (Msg != GetLangMessage.GetMessage("Msg1020")) { // If the button pushing is invalid, return and not update the status. return; } } if (NotifyRestTime != null) { NotifyRestTime.Cancel(); } CommonViewModel.RecentSelectedEachTaskId = SelectedEachTaskId; // Update Recent status SetRecentInfo("Msg1012"); } catch { CommonViewModel.NotifySystemMessage(GetLangMessage.GetMessage("Exception")); } }
public async void ChangeSmallTaskCompleteFlag() { await TimeInfoModel.ChangeComplateFlag(EachTaskId, !IsComplete); }