Ejemplo n.º 1
0
        public int CreateVersion(ProjectVersionModel projectVersion)
        {
            var version = new ProjectVersion();

            if (projectVersion != null)
            {
                version = ApplicationMapper.MapProjectVersion(projectVersion);
            }

            var project = new Project();

            if (projectVersion != null)
            {
                project = projectRepository.GetProject(projectVersion.ProjectId);
            }

            ISerializer xmlSerializer = new SerializeXml();

            xmlSerializer.Serialize(project);
            version.ProjectData = xmlSerializer.Serialize(project);

            int versionId = projectRepository.CreateVersion(version);

            //generate PDF
            PdfGenerator.GeneratePdf(project, projectVersion.PublishedByName, versionId, false, projectRepository.GetRoles());

            return(versionId);
        }
Ejemplo n.º 2
0
        public ProjectVersionModel GetProjectVersion(int id)
        {
            ProjectVersionModel versionModel   = null;
            ProjectVersion      projectVersion = projectRepository.GetVersion(id);

            if (projectVersion != null)
            {
                versionModel = ApplicationMapper.MapProjectVersion(projectVersion);
            }
            return(versionModel);
        }