示例#1
0
        public bool AssignSection(ProjectSectionModel model)
        {
            var projectSection = _sectionProjectRepository.GetSectionProjectByIds(model.SectionId, model.ProjectId);

            if (projectSection != null)
            {
                throw new ProjectAlreadyInSectionException("El proyecto ya esta registrado en esa seccion.");
            }

            _projectRepository.AssignToSection(model.ProjectId, model.SectionId);
            _projectRepository.Save();
            return(true);
        }
示例#2
0
 public IHttpActionResult PostRemoveSection(ProjectSectionModel model)
 {
     _services.RemoveFromSection(model.ProjectId, model.SectionId);
     return(Ok());
 }
示例#3
0
 public IHttpActionResult PostAssignSection(ProjectSectionModel model)
 {
     _services.AssignSection(model);
     return(Ok());
 }