Exemplo n.º 1
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);
        }
Exemplo n.º 2
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();
        }