示例#1
0
        private ControlInfo BuildStages(TblCurriculums curriculum, TreeNode node, DateTime? date)
        {
            IList<TblStages> stages = StudentRecordFinder.GetStagesForCurriculum(curriculum);

            ControlInfo controlInfo = new ControlInfo();

            foreach (TblStages stage in stages)
            {
                var child = new IdendtityNode(stage);

                if (StudentPermissionsHelper.IsDateAllowed(date, _userId, stage.ID, NodeType.Stage, GetOperationType))
                {
                    controlInfo = BuildThemes(stage, child);

                    if (controlInfo.IsControlStartsNow)
                    {
                        controlInfo.AddCurriculumnToInfo(curriculum);
                        return controlInfo;
                    }
                    if (child.ChildNodes.Count != 0)
                        node.ChildNodes.Add(child);
                }
            }

            return controlInfo;
        }
示例#2
0
        private void SelectDatesForObject(IdendtityNode selectedNode)
        {
            IList<DatePeriod> datePeriods;


            if(selectedNode.Type == NodeType.Theme)
                datePeriods = StudentPermissionsHelper.GetPermissionsDatePeriods(_userId, ((IdendtityNode)selectedNode.Parent).ID, ((IdendtityNode)selectedNode.Parent).Type, GetOperationType);
            else
                datePeriods = StudentPermissionsHelper.GetPermissionsDatePeriods(_userId, selectedNode.ID, selectedNode.Type, GetOperationType);


            if (datePeriods.Count == 0)
                SelectDates(DateTime.Today, DateTime.Today.AddYears(1));
            else
                SelectDatesPeriods(datePeriods);
        }
示例#3
0
        private ControlInfo BuildTree(DateTime? date)
        {
            CurriculumnTreeView.Nodes.Clear();

            var userCurriculums = StudentRecordFinder.GetCurriculumnsForUser(_userId);

            var controlInfo = new ControlInfo();

            foreach (TblCurriculums curriculum in userCurriculums)
            {
                var node = new IdendtityNode(curriculum);

                if (StudentPermissionsHelper.IsDateAllowed(date, _userId, node.ID, node.Type, GetOperationType))
                {
                    controlInfo = BuildStages(curriculum, node, date);

                    if (controlInfo != null && controlInfo.IsControlStartsNow)
                        return controlInfo;

                    if (node.ChildNodes.Count != 0)
                        CurriculumnTreeView.Nodes.Add(node);
                }
            }

            CurriculumnTreeView.ExpandAll();

            return controlInfo;
        }
示例#4
0
        private void BuildTreeForControl(ControlInfo info)
        {
            CurriculumnTreeView.Nodes.Clear();

            var themeNode = new IdendtityNode(info.Theme);

            var stageNode = new IdendtityNode(info.Stage);
            stageNode.ChildNodes.Add(themeNode);

            var currNode = new IdendtityNode(info.Curriculumn);
            currNode.ChildNodes.Add(stageNode);

            CurriculumnTreeView.Nodes.Add(currNode);
            CurriculumnTreeView.ExpandAll();
        }