示例#1
0
 public ActionResult BugListing(long projectId, long statusId)
 {
     var bugs = _bugLogic.GetList(statusId);
     var bugViewModels = new List<BugViewModel>();
     bugs.ForEach(b =>
     {
         var bugViewModel = new BugViewModel
         {
             BugId = b.BugId,
             BugName = b.BugName,
             Description = b.Description,
             BugStatusId = b.BugStatusId,
             BugStatusName = _bugStatusLogic.Get(b.BugStatusId).BugStatusName,
             AssignerId = b.UserId,
             AssignerName = _userLogic.Get(b.UserId).UserName,
             CreateDate = b.CreateDate,
             UpdateTime = b.UpdateTime,
         };
         bugViewModels.Add(bugViewModel);
     });
     return PartialView(bugViewModels);
 }
示例#2
0
 public ActionResult EditIssue(long projectId, long bugId)
 {
     var bugStatusNames = new List<string>();
     _bugStatusLogic.GetList(projectId).ForEach(status => bugStatusNames.Add(status.BugStatusName));
     var dictionary = new Dictionary<long, string>();
     var userProjectRoleRelations = _userProjectRoleRelationLogic.GetByProjectId(projectId);
     userProjectRoleRelations.ForEach(uprr =>
     {
         var user = _userLogic.Get(uprr.UserId);
         dictionary.Add(user.UserId, user.UserName);
     });
     var bug = _bugLogic.Get(bugId);
     var bugViewModel =new BugViewModel()
         {
             BugId = bug.BugId,
             BugName = bug.BugName,
             Description = bug.Description??string.Empty,
             BugStatusName = _bugStatusLogic.Get(bug.BugStatusId).BugStatusName,
             AssignerId = bug.UserId,
             ProjectId = projectId
         };
     var addEditBugViewModel =new AddEditBugViewModel()
         {
             Members = dictionary,
             BugStatusNames = bugStatusNames,
             ProjectId = projectId,
             BugViewModel = bugViewModel
         };
     return PartialView(addEditBugViewModel);
 }
示例#3
0
 public ActionResult BugList(long projectId,int count,int page,string kw)
 {
     var bugStatuses = _bugStatusLogic.GetList(projectId);
     var statusIds=new List<long>();
     bugStatuses.ForEach(bs => statusIds.Add(bs.BugStatusId));
     var total = _bugLogic.GetTotal(statusIds,kw);
     var bugs = _bugLogic.GetBugs(statusIds, count, page, kw);
     var bugViewModels=new List<BugViewModel>();
     bugs.ForEach(b =>
         {
             var bugViewModel=new BugViewModel
                 {
                     BugId = b.BugId,
                     BugName = b.BugName,
                     Description = b.Description,
                     BugStatusId = b.BugStatusId,
                     BugStatusName = _bugStatusLogic.Get(b.BugStatusId).BugStatusName,
                     AssignerId = b.UserId,
                     AssignerName = _userLogic.Get(b.UserId).UserName,
                     CreateDate = b.CreateDate,
                     UpdateTime = b.UpdateTime,
                 };
             bugViewModels.Add(bugViewModel);
         });
     var bugListViewModel=new BugListViewModel()
         {
             ProjectId = projectId,
             BugViewModels = bugViewModels,
             PageViewModel = new PageViewModel(total,count,page)
             };
     return PartialView(bugListViewModel);
 }