Пример #1
0
        /// <summary>
        /// Launches the edit task window.
        /// </summary>
        public void EditProject()
        {
            ProjectView window = new ProjectView();

            ProjectViewModel selectedProjectVM = AllProjects.FirstOrDefault(p => p.IsSelected == true);

            using (var viewModel = new ProjectViewModel(_projectData.GetProjectByProjectId(selectedProjectVM.ProjectId), _projectData, _taskData))
            {
                this.ShowWorkspaceAsDialog(window, viewModel);
            }
        }
Пример #2
0
        public static Task CreateNewTask(int?projectId = null)
        {
            Task newTask = new Task()
            {
                IsActive   = false,
                StatusId   = (int)Statuses.New,
                PriorityId = (int)TaskPriorities.Medium,
                SortOrder  = null
            };

            if (projectId.HasValue)
            {
                using (ProjectData projectData = new ProjectData())
                {
                    newTask.ParentProject = projectData.GetProjectByProjectId(projectId.Value);
                }
            }

            return(newTask);
        }