private void LoadDropDownSchool()
        {

            var schoolsForLooggedInUser = SchoolMasterList.GetSchoolsForUser(SessionObject.LoggedInUser);
            schoolsForLooggedInUser = SchoolID != default(int?) ? schoolsForLooggedInUser.Where(e => e.ID == SchoolID).ToList() : schoolsForLooggedInUser.Where(e => e.Name != "District Office").ToList();
            if (schoolsForLooggedInUser.Count > 1)
            {
                Base.Classes.School firstSchool = new Base.Classes.School {Name = "School", ID = 0};
                schoolsForLooggedInUser.Insert(0,firstSchool);
            }

            cmbSchool.DataTextField = "Name";
            cmbSchool.DataValueField = "ID";
            cmbSchool.DataSource = schoolsForLooggedInUser;
            cmbSchool.DataBind();
        }
Пример #2
0
		private void LoadSchool()
		{
			if (Request.QueryString["xID"] == null)
			{
				SessionObject.RedirectMessage = "No entity ID provided in URL.";
				Response.Redirect("~/PortalSelection.aspx", true);
			}
			else
			{
                _schoolId = GetDecryptedEntityId(X_ID);
                SessionObject.LoggedInUser.School = _schoolId;
              
				var key = "School_" + _schoolId;
				if (!RecordExistsInCache(key)) return;
				_selectedSchool = ((Base.Classes.School)Base.Classes.Cache.Get(key));
				schoolName.Text = _selectedSchool.Name;
			}
		}