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); }
private void CreateStageList() { StageDropDownList.Items.Clear(); ThemeDropDownList.Items.Clear(); if (CurriculumnDropDownList.SelectedItem != null) { var selectedCurriculumn = ServerModel.DB.Load <TblCurriculums>(int.Parse(CurriculumnDropDownList.SelectedItem.Value)); var stages = StudentRecordFinder.GetStagesForCurriculum(selectedCurriculumn); foreach (var s in stages) { StageDropDownList.Items.Add(new ListItem(s.Name, s.ID.ToString())); } } }