Exemplo n.º 1
0
        public void test_81_getUsersInGroup_negative_input()
        {
            String s = "";

            try
            {
                IQueryable <User> test_collection = d.getUsersInGroup(-1);
            }
            catch (Exception e)
            {
                s = e.ToString();
            }

            Assert.IsTrue(s.Contains("ArgumentOutOfRangeException"));
        }
Exemplo n.º 2
0
        public ActionResult Barometer(int report_id = 0)
        {
            BaroReportWrapper viewModel =
                db.ProjectReportDates
                .Where(r => r.id == report_id)
                .Select(r => new BaroReportWrapper
            {
                ReportDate = r,
                Project    = r.Project,
                Aspects    = r.Project.BaroTemplate.BaroAspects.Where(a => a.is_head_aspect == 1).ToList()
            }).FirstOrDefault();

            if (viewModel == null)
            {
                return(HttpNotFound());
            }

            ProjectGroup group = daoStudent.getStudentGroup(curUser.Studentnummer).First();

            if (group == null)
            {
                return(RedirectToAction("Dashboard"));
            }


            viewModel.ReporterId = curUser.StudentId;
            viewModel.Members    = daoProject.getUsersInGroup(group.id).ToList();


            return(View(viewModel));
        }
Exemplo n.º 3
0
        private void FillUsersInGroups()
        {
            List <ProjectGroup> projectGroups = new List <ProjectGroup>();

            UsersInGroups = new Dictionary <string, IEnumerable <User> >();
            foreach (Project project in OwnProjects)
            {
                projectGroups.AddRange(projectDAO.getProjectGroupsByProject(project.id));
            }
            foreach (ProjectGroup projectGroup in projectGroups)
            {
                UsersInGroups.Add(projectGroup.group_code, projectDAO.getUsersInGroup(projectGroup.id));
            }
        }
Exemplo n.º 4
0
 private void FillProjectMembers(ProjectGroup projectGroup)
 {
     ProjectMembers = project.getUsersInGroup(projectGroup.id);
 }