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();
 }
Beispiel #3
0
 public void AddUser(User user)
 {
     UserRepo.Create(user);
     UserRepo.SaveChange();
 }
Beispiel #4
0
 public void AddTask(Task task)
 {
     TaskRepo.Create(task);
     TaskRepo.SaveChange();
 }
 public void AddParentTask(ParentTask pTask)
 {
     pTaskRepo.Create(pTask);
     pTaskRepo.SaveChange();
 }