示例#1
0
        private void LoadPickers()
        {
            ddlCampuses.Items.Clear();
            var campuses = CampusCache.All().OrderBy(a => a.Name);

            foreach (var campus in campuses)
            {
                var listItem = new ListItem();
                listItem.Text  = campus.Name;
                listItem.Value = campus.Id.ToString();
                ddlCampuses.Items.Add(listItem);
            }
            if (campuses.Count() < 2)
            {
                _campusId           = campuses.First().Id;
                ddlCampuses.Enabled = false;
                ddlCampuses.Visible = false;
                ExtensionMethods.AddCssClass((HtmlControl)campusContainer, "hidden");
            }

            PopulateGroups();
            PopulateLocations();
            PopulateInstances();
        }