public Project Create(Project project) { try { ProjectRepo projectRepository = new ProjectRepo(); if (projectRepository.DoesProjectExist(project.ProjectName)) { throw new ValidationServiceException("Project with this name = " + project.ProjectName + ", already exist in database."); } projectRepository.Create(project); return(project); } catch (ValidationServiceException) { throw; } catch (RepositoryException) { throw; } catch (Exception ex) { throw new ServiceException("User with this Username = "******", already exists in database.", ex); } }
public ActionResult New(NewProjectViewModel vm) { if (ModelState.IsValid) { //Map the viewmodel values to the DB model and then save it Project newProject = Mapper.From(vm); newProject = projectRepo.Create(newProject); return(RedirectToAction("index")); } return(View(vm)); }
public Project MakeProject(Project project) { Project newProject = ProjectRepo.Create(project); newProject.CurrentPhase = project.CurrentPhase; newProject.CurrentPhase.Project = newProject; ProjectRepo.Create(newProject.CurrentPhase); ProjectRepo.Update(newProject); return(newProject); }
internal UserProject Create(UserProject userProject, int creatorId) { return(_projectRepo.Create(userProject, creatorId)); }
public void MakePhase(Phase newPhase) { ProjectRepo.Create(newPhase); }
public void MakeProjectImage(byte[] img, int project) { ProjectRepo.Create(img, project); }