コード例 #1
0
ファイル: BTSController.cs プロジェクト: slaq777/lmsystem
        public BugListViewModel FromBug(Bug bug)
        {
            var context = new ProjectManagementService();

            var isAssigned = false;
            var user = context.GetProjectsOfUser(WebSecurity.CurrentUserId).Count(e => e.ProjectId == bug.ProjectId && e.UserId == WebSecurity.CurrentUserId);
            if (user != 0)
            {
                isAssigned = true;
            }

            return new BugListViewModel
            {
                Id = bug.Id,
                Steps = bug.Steps,
                Symptom = GetSymptomName(bug.SymptomId),
                ProjectId = bug.ProjectId,
                ReporterName = context.GetCreatorName(bug.ReporterId),
                ReportingDate = bug.ReportingDate.ToShortDateString(),
                Summary = string.Format("<a href=\"{0}\">{1}</a>", Url.Action("BugDetails", "BTS", new { id = bug.Id }), bug.Summary),
                Severity = GetSeverityName(bug.SeverityId),
                Status = GetStatusName(bug.StatusId),
                StatusId = bug.StatusId,
                Project = GetProjectTitle(bug.ProjectId),
                ModifyingDate = bug.ModifyingDate.ToShortDateString(),
                AssignedDeveloperName = (bug.AssignedDeveloperId == 0) ? "отсутствует" : context.GetCreatorName(bug.AssignedDeveloperId),
                IsAssigned = isAssigned
            };
        }
コード例 #2
0
        public List<string> GetProjectCreatorNameList(int studentId)
        {
            var context = new ProjectManagementService();
            var projectUserList = context.GetProjectsOfUser(studentId).ToList();
            var projectCreatorNameList = new List<string>();
            foreach (var project in projectUserList)
            {
                var creator =
                    new LmPlatformRepositoriesContainer().UsersRepository.GetBy(
                        new Query<User>(e => e.Id == project.Project.CreatorId));
                projectCreatorNameList.Add(context.GetCreatorName(creator.Id));
            }

            return projectCreatorNameList;
        }