Ejemplo n.º 1
0
        public UserDashboardWrapper(int studentNumber)
        {
            this.StudentNumber = studentNumber;
            student            = DatabaseFactory.getInstance().getDAOStudent();
            project            = DatabaseFactory.getInstance().getDAOProject();


            FillCurrentProject();
            if (HasProject)
            {
                FillNextReportDate();
                FillProjectMembers(student.getStudentGroup(studentNumber).First());
                FillCurrentProjectOwners(student.getStudentGroup(studentNumber).First());
                CurrentProjectTutor = ProjectMembers.FirstOrDefault().ProjectGroup.User;
            }


            try
            {
                FillAllProjects();
                FillAllIndividualGrades();
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex.Message + " in " + ex.Source);
                // doe niks met error. (dit laten staan)
            }
        }
Ejemplo n.º 2
0
        public MainWindow()
        {
            InitializeComponent();

            productStructureTree.ItemsSource = Stuff.GetStuff();

            DAOProject designProject = new DAOProject(this);
        }
Ejemplo n.º 3
0
        private void FillGrades(Project p)
        {
            project = DatabaseFactory.getInstance().getDAOProject();

            Grades = new Dictionary <BaroAspect, Dictionary <ProjectReportDate, Dictionary <Report, int> > >();

            foreach (var v in project.GetBaroAspect(project.GetProject(this.studentNumber, projectId).FirstOrDefault().id))
            {
                Grades.Add(v, FillSecondDictionary());
            }
        }
Ejemplo n.º 4
0
 public AdminProjectDetailWrapper(int projectNumber)
 {
     this.projectNumber = projectNumber;
     project            = DatabaseFactory.getInstance().getDAOProject();
     ProjectName        = project.getProjectName(projectNumber);
     ProjectDescription = project.getProjectSummary(projectNumber);
     GetDates();
     //CurrentProjectIndividualGrade = mist nog, weet niet wat het is en is geen query voor
     ProjectMembers = project.getStudents(projectNumber);
     ProjectOwners  = project.GetProjectOwners(projectNumber);
     // Tutors = mist nog, tutors kan alleen per groep, weet niet of je wat aan een array hebt
     Groups = project.getProjectGroupsByProject(projectNumber);
 }
Ejemplo n.º 5
0
        public UserProjectWrapper(int studentNumber, int project_id)
        {
            this.projectId     = project_id;
            this.studentNumber = studentNumber;
            StudentNumber      = studentNumber;
            student            = DatabaseFactory.getInstance().getDAOStudent();
            project            = DatabaseFactory.getInstance().getDAOProject();
            FillProjectMembers(student.getStudentGroup(studentNumber).First());
            FillTutors(student.getStudentGroup(studentNumber).First());


            FillProjectOwners(project.GetProject(this.studentNumber, projectId).FirstOrDefault());
            FillProjectDetails(project.GetProject(this.studentNumber, projectId).FirstOrDefault(), student.getStudentGroup(studentNumber).First());
            FillMyGrades(project.GetProject(this.studentNumber, projectId).FirstOrDefault());
            FillGrades(project.GetProject(this.studentNumber, projectId).FirstOrDefault());
            FillSubAspects(project.GetProject(this.studentNumber, projectId).FirstOrDefault());
            FillSubSubAspects(project.GetProject(this.studentNumber, projectId).FirstOrDefault());
        }
Ejemplo n.º 6
0
        public ActionResult AddStudent(FormCollection collection)
        {
            int        studentIdToAdd = int.Parse(collection.GetValue("student").AttemptedValue);
            int        projectId      = int.Parse(collection.GetValue("projectID").AttemptedValue);
            int        groupId        = int.Parse(collection.GetValue("groupID").AttemptedValue);
            DAOStudent studentdao     = DatabaseFactory.getInstance().getDAOStudent();
            DAOProject projectdao     = DatabaseFactory.getInstance().getDAOProject();

            BarometerDataAccesLayer.User studentUser = studentdao.getStudentInfo(studentIdToAdd);
            IEnumerable <BarometerDataAccesLayer.ProjectMember> member = studentUser.ProjectMembers.Where(pm => pm.project_group_id == groupId);

            if (member.Count() == 0)
            {
                BarometerDataAccesLayer.ProjectMember pMember = new BarometerDataAccesLayer.ProjectMember();
                pMember.User             = studentUser;
                pMember.project_group_id = groupId;
                BarometerDataAccesLayer.DatabaseClassesDataContext context = DatabaseFactory.getInstance().getDataContext();
                context.ProjectMembers.InsertOnSubmit(pMember);
                context.SubmitChanges();
            }

            return(RedirectToAction("ProjectGroups", new { groupId = groupId }));
        }
Ejemplo n.º 7
0
 public ProjectController(ILogger <ProjectController> logger, Context context)
 {
     _logger = logger;
     _dao    = new DAOProject(context);
 }