public ActionResult Create(ProjectManagerViewModel model) { try { // TODO: Add insert logic here if (!ModelState.IsValid) { return(View(model)); } var ProjectManager = _mapper.Map <ProjectManager>(model); var isSuccess = _repo.Create(ProjectManager); if (!isSuccess) { ModelState.AddModelError("", "Something Went Wrong!"); return(View(model)); } return(RedirectToAction(nameof(Index))); } catch { ModelState.AddModelError("", "Something Went Wrong!"); return(View(model)); } }
public void AddProject(Project proj) { projRepo.Create(proj); projRepo.SaveChange(); }
public void AddUser(User user) { UserRepo.Create(user); UserRepo.SaveChange(); }
public void AddTask(Task task) { TaskRepo.Create(task); TaskRepo.SaveChange(); }
public void AddParentTask(ParentTask pTask) { pTaskRepo.Create(pTask); pTaskRepo.SaveChange(); }