コード例 #1
0
        /// <summary>
        /// Function to validate project.
        /// </summary>
        /// <param name="project">Project information</param>
        /// <returns>List of errors</returns>
        public IList<ErrorListItem> Validate(Project project)
        {
            if (project == null)
            {
                throw new ArgumentNullException(ProjectConst);
            }

            return this.projectRepository.Validate(project);
        }
コード例 #2
0
        /// <summary>
        /// Saves the project.
        /// </summary>
        /// <param name="project">The project.</param>
        /// <param name="artifacts">The artifact</param>
        /// <param name="developerId">The developerId.</param>
        public void InsertOrUpdate(Project project, IList<ArtifactFillListItem> artifacts, int developerId)
        {
            if (project == null)
            {
                throw new ArgumentNullException(ProjectConst);
            }

            project.ModifiedByDeveloperID = developerId;
            project.Name = !string.IsNullOrEmpty(project.Name) ? project.Name.Trim() : project.Name;

            if (artifacts != null)
            {
                project.ProjectArtifacts = artifacts.RetrieveAddedOrDeleted().Select(item => item.MapToProjectArtifact(project)).ToList();
            }

            this.projectRepository.InsertOrUpdate(project);
            this.unitOfWork.Save();
        }