public void ShowDialogNewProject() { var newCurrentProject = new DialogDefineProjects().ShowDialogNewProject(ProjectHandler); if (newCurrentProject != null) { ProjectCorrectionHandler.addNewCurrentProject(newCurrentProject.ProjectName, newCurrentProject.Comment); } }
public void ShowDialogSplitCurrentProject() { List <WorktimeRecord> projects = new DialogDefineProjects().ShowDialogDistraction(ProjectHandler); if (projects != null && projects.Count > 0) { ProjectCorrectionHandler.splitCurrentProject(projects); } }
public void ShowDialogAddComment() { //new DialogDefineProjects().ShowDialogChangeCurrentProject(ProjectHandler); List <WorktimeRecord> projects = new DialogDefineProjects().ShowDialogSince(ProjectHandler); if (projects != null && projects.Count > 0) { ProjectCorrectionHandler.splitCurrentProject(projects); } }
public override bool process(ProjectChangeEvent projectChangeEvent) { if (projectChangeEvent.Type == ProjectChangeEvent.Types.Lock) { //Hack: Just replace event data instead of refiring, because the old event is per definition invalid projectChangeEvent.Type = ProjectChangeEvent.Types.Finish; return(false); } if (projectChangeEvent.Type == ProjectChangeEvent.Types.Unlock) { var outlookAppointments = Util.OutlookAppointmentRetriever.retrieveAppointments( projectChangeEvent.WorktimeRecord.Start, projectChangeEvent.WorktimeRecord.End); List <WorktimeRecord> breakTimes = new DialogDefineProjects().ShowDialogMeantime( projectChangeEvent.WorktimeRecord.Start, projectChangeEvent.WorktimeRecord.End, Handler, outlookAppointments); if (breakTimes != null && breakTimes.Count > 0) { var currentProject = breakTimes.Last(); breakTimes.Remove(currentProject); foreach (var brk in breakTimes) { OnRaiseProjectChangeEvent(new ProjectChangeEvent( ProjectChangeEvent.Types.Start, currentProject.ProjectName, currentProject.Comment, brk)); } } return(true); } return(false); }