Ejemplo n.º 1
0
        private EducationOrganizationHeaderModel GetEducationOrganizationBriefModel()
        {
            int localEducationAgencyId = EdFiDashboardContext.Current.LocalEducationAgencyId ?? 0;

            var localEducationAgencyBrief =
                localEducationAgencyBriefService.Get(new BriefRequest { LocalEducationAgencyId = localEducationAgencyId });

            var model = new EducationOrganizationHeaderModel
            {
                Id = localEducationAgencyBrief.LocalEducationAgencyId,
                Name = localEducationAgencyBrief.Name,
                ProfileThumbnail = localEducationAgencyBrief.ProfileThumbnail
            };
            return model;
        }
Ejemplo n.º 2
0
        public ActionResult EducationOrganizationHeader()
        {
            var schoolBriefModel = GetSchoolBriefModel();

            var model = new EducationOrganizationHeaderModel
                            {
                                Id = schoolBriefModel.SchoolId,
                                Name = schoolBriefModel.Name,
                                ProfileThumbnail = schoolBriefModel.ProfileThumbnail
                            };

            var userInfo = UserInformation.Current;
            if (userInfo != null)
            {
                var schools = userInfo.AssociatedSchools;
                if (schools.Count() > 1)
                {
                    foreach(var school in schools.OrderBy(x=> x.Name))
                        model.AssociatedEducationOrganizations.Add(new EducationOrganizationHeaderModel.AssociatedEducationOrganization{Name = school.Name, Href = schoolLinks.Default(school.SchoolId) });
                }
            }

            return PartialView(model);
        }