Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        public ActionResult AddBug()
        {
            var addBugViewModel = new AddOrEditBugViewModel(0);
            if (_currentProjectId == 0)
            {
                return PartialView("_AddBugForm", addBugViewModel);
            }

            return PartialView("_AddBugOrCurrentProjectForm", addBugViewModel);
        }
Ejemplo n.º 3
0
        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);
        }