Beispiel #1
0
        public ProjectResult Show(string id, bool withDetails)
        {
            var             intId = Convert.ToInt32(id);
            ProjectViewData project;

            if (withDetails)
            {
                project = new ProjectViewData(ProjectManagementService
                                              .GetProjectWithData(intId, true), withBugs: true, withMembers: true);
            }
            else
            {
                project = new ProjectViewData(ProjectManagementService.GetProjectWithData(intId));
            }
            return(new ProjectResult
            {
                Project = project
            });
        }
Beispiel #2
0
        public void addProject(string name, string client_name, string path)
        {
            if (!File.Exists(Path.GetFullPath(path)))
            {
                throw new FileNotFoundException("project file not found");
            }
            if (!path.EndsWith(Reference.PROJECT_FILE_EXTENSION))
            {
                throw new InvalidPathError("project file path must ends with : " + Reference.PROJECT_FILE_EXTENSION);
            }
            foreach (var proj in recent_projects)
            {
                if (Path.GetFullPath(path).Equals(Path.GetFullPath(proj.path)))
                {
                    return;
                }
            }
            ProjectViewData data = new ProjectViewData(name, client_name, path);

            recent_projects.Insert(0, data);
        }