Example #1
0
        public Project Create(Project project)
        {
            Ensure.NotNull(project);
            var result = _repo.Create(project);

            _repo.Save();
            return(result);
        }
 public IActionResult Create(CreateProjectVM projectvm)
 {
     if (ModelState.IsValid)
     {
         Project project = projectvm.CreateProject();
         _projects.Create(project);
         return(RedirectToAction("Index"));
     }
     return(View());
 }
Example #3
0
 public ActionResult Create(ProjectViewModel pvm)
 {
     try
     {
         Project project = pvm.Project;
         project.Firm = firmRepo.GetById(pvm.SelectedFirmId);
         projectRepo.Create(project);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View(pvm));
     }
 }
 public Project CreateProject(Project project)
 {
     return(_projectRepo.Create(project.AsDataModel()).AsViewModel());
 }