public ActionResult SaveBug(AddOrEditBugViewModel model) { model.Save(WebSecurity.CurrentUserId, _currentProjectId); var bugLog = new BugLog { BugId = model.BugId, UserId = WebSecurity.CurrentUserId, UserName = ProjectManagementService.GetCreatorName(WebSecurity.CurrentUserId), PrevStatusId = _prevBugStatus, CurrStatusId = model.StatusId, LogDate = DateTime.Now }; if (model.BugId != 0) { model.SaveBugLog(bugLog); } return null; }
public ActionResult AddBug() { var addBugViewModel = new AddOrEditBugViewModel(0); if (_currentProjectId == 0) { return PartialView("_AddBugForm", addBugViewModel); } return PartialView("_AddBugOrCurrentProjectForm", addBugViewModel); }
public ActionResult EditBug(int id) { var bug = BugManagementService.GetBug(id); _currentProjectId = bug.ProjectId; var bugViewModel = new AddOrEditBugViewModel(id); _prevBugStatus = bugViewModel.StatusId; var projectUser = new ProjectManagementService().GetProjectUsers(bug.ProjectId).Single(e => e.UserId == WebSecurity.CurrentUserId); if ((projectUser.ProjectRoleId == 1 && bug.StatusId == 2) || (projectUser.ProjectRoleId == 3 && bug.StatusId == 1)) { return PartialView("_EditBugFormWithAssignment", bugViewModel); } return PartialView("_EditBugFormWithAssignment", bugViewModel); }