/// <summary> /// Shows the edit details. /// </summary> /// <param name="campus">The <see cref="Campus"/>.</param> private void ShowEditDetails(Campus campus) { if (campus == null) { return; } if (campus.Id == 0) { lActionTitle.Text = ActionTitle.Add(Campus.FriendlyTypeName).FormatAsHtmlTitle(); hlStatus.Visible = false; } else { lActionTitle.Text = ActionTitle.Edit(campus.Name).FormatAsHtmlTitle(); SetStatusLabel(campus); } SetEditMode(true); LoadDropDowns(); tbCampusName.Text = campus.Name; cbIsActive.Checked = !campus.IsActive.HasValue || campus.IsActive.Value; tbDescription.Text = campus.Description; dvpCampusStatus.SetValue(campus.CampusStatusValueId); dvpCampusType.SetValue(campus.CampusTypeValueId); tbCampusCode.Text = campus.ShortCode; urlCampus.Text = campus.Url; pnbPhoneNumber.Number = campus.PhoneNumber; lpLocation.Location = campus.Location; ddlTimeZone.SetValue(campus.TimeZoneId); ppCampusLeader.SetValue(campus.LeaderPersonAlias != null ? campus.LeaderPersonAlias.Person : null); kvlServiceTimes.Value = campus.ServiceTimes; CampusSchedulesState = campus.CampusSchedules.OrderBy(s => s.Order).ThenBy(s => s.Schedule.Name) .Select( s => new CampusScheduleDTO { Guid = s.Guid, Schedule = s.Schedule.Name, ScheduleId = s.ScheduleId, ScheduleType = s.ScheduleTypeValue.Value, ScheduleTypeId = s.ScheduleTypeValueId.Value, Order = s.Order }).ToList(); BindCampusSchedulesGrid(); campus.LoadAttributes(); avcAttributes.ExcludedAttributes = campus.Attributes.Where(a => !a.Value.IsAuthorized(Rock.Security.Authorization.EDIT, this.CurrentPerson)).Select(a => a.Value).ToArray(); avcAttributes.AddEditControls(campus); }