/// <summary>
        /// Launches the edit goal window.
        /// </summary>
        public void EditGoal()
        {
            GoalView window = new GoalView();

            GoalViewModel selectedGoalVM = AllGoals.FirstOrDefault(g => g.IsSelected == true);

            using (var viewModel = new GoalViewModel(_goalData.GetGoalByGoalId(selectedGoalVM.GoalId), _goalData, _projectData, _taskData))
            {
                this.ShowWorkspaceAsDialog(window, viewModel);
            }
        }
Esempio n. 2
0
        public static Project CreateNewProject(int? goalId = null)
        {
            Project newProject = new Project()
            {
                StatusId = (int)Statuses.New
            };

            if (goalId.HasValue)
            {
                using (GoalData goalData = new GoalData())
                {
                    newProject.ParentGoal = goalData.GetGoalByGoalId(goalId.Value);
                }
            }

            return newProject;
        }