public void Update(Project project) { var single = Get(project.ProjectId); single.ProjectName = project.ProjectName; single.Description = project.Description; _bugTrackDbContext.SaveChanges(); }
public SettingsViewModel ToSettingsViewModelFromProject(Project project) { return new SettingsViewModel() { ProjectName = project.ProjectName, Description = project.Description, ProjectId = project.ProjectId }; }
public void Update(Project project) { _projectRepository.Update(project); }
public void CreateProject(Project project) { _projectRepository.Add(project); }
public void Add(Project project) { _bugTrackDbContext.Projects.Add(project); _bugTrackDbContext.SaveChanges(); }
public ActionResult CreateProject(CreateProjectViewModel createProjectViewModel) { try { var project = new Project { ProjectName = createProjectViewModel.ProjectName, Description = createProjectViewModel.Description, CreateDate = DateTime.Now, Sole = Guid.NewGuid() }; var userId = _cookieHelper.GetUserId(Request); _projectLogic.CreateProject(project); var projectId = _projectLogic.Get(project.ProjectName,project.Sole).ProjectId; var userProjectRoleRelation=new UserProjectRoleRelation { ProjectId = projectId, UserId = userId, RoleId = RoleConfig.Creator }; _userProjectRoleRelationLogic.Add(userProjectRoleRelation); return new RedirectResult(Url.Action("Index", "Project")); } catch { return View("Error"); } }
public ActionResult Update([ModelBinder(typeof(JsonBinder<SettingsViewModel>))]SettingsViewModel settingsViewModel) { var jsonResult = new JsonResult(); try { var project = new Project { ProjectId = settingsViewModel.ProjectId, ProjectName = settingsViewModel.ProjectName, Description = settingsViewModel.Description }; _projectLogic.Update(project); jsonResult.Data = new { IsSuccess = true }; } catch (Exception) { jsonResult.Data = new { IsSuccess = false }; } return jsonResult; }