Пример #1
0
        } //Earlier

        /*var regularincomplete = subSession.Where(x => x.IsRegular)
         *  .Select(x => x.SubjectStructure.Subject).ToList();
         * var notregularincomplete = subSession.Where(x => !x.IsRegular)
         *  .Select(x => x.Subject).ToList();
         * regularincomplete.AddRange(notregularincomplete);*/
        private void LoadData()
        {
            using (var helper = new DbHelper.Subject())
            {
                #region Using Subject Class but its not complete

                var subClss = helper.ListCurrentSubjectClasses(UserId);
                var run     = subClss.Where(x => x.IsRegular).GroupBy(x => x.RunningClass);
                foreach (var r in run)
                {
                    var nodeuc = (EarlierUc_NodesUc)
                                 Page.LoadControl("~/ViewsSite/User/ModulesUc/EarlierUc_NodesUc.ascx");
                    //key is used to display year/subyear
                    var subjects = r.Select(x => x.SubjectStructure.Subject).Distinct().OrderBy(x => x.FullName).ToList();
                    nodeuc.SetStructureData(r.Key.Year, r.Key.SubYear, subjects);
                    pnlRegularCourses.Controls.Add(nodeuc);

                    //lbltitle.ToolTip = r.Key.ProgramBatch.NameFromBatch;
                }
                var irrRun = subClss.Where(x => !x.IsRegular)
                             .Select(x => x.Subject).Distinct().OrderBy(x => x.FullName).ToList();

                if (irrRun.Any())
                {
                    divNonRegular.Visible = true;
                    dListNonRegularSubjects.DataSource = irrRun;
                    dListNonRegularSubjects.DataBind();
                }
                else
                {
                    divNonRegular.Visible = false;
                    dListNonRegularSubjects.DataSource = null;
                    dListNonRegularSubjects.DataBind();
                }

                #endregion
            }
        }