/// <summary>Raises the <see cref="Control.Init"/> event.</summary> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected override void OnInit(EventArgs e) { if (!PermissionController.CanManageJobDetailOptions(this)) { this.DenyAccess(); return; } this.Load += this.Page_Load; this.UpdateButton.Click += this.UpdateButton_Click; this.CancelButton.Click += this.CancelButton_Click; this.LeadItemsGridView.RowDataBound += this.LeadItemsGridView_RowDataBound; this.LeadItemsGridView.RowCancelingEdit += this.LeadItemsGridView_RowCancelingEdit; this.LeadItemsGridView.RowEditing += this.LeadItemsGridView_RowEditing; this.LeadItemsGridView.RowCommand += this.LeadItemsGridView_RowCommand; this.LeadItemsGridView.RowDeleting += this.LeadItemsGridView_RowDeleting; this.NewLeadItemButton.Click += this.NewLeadItemButton_Click; this.SaveNewLeadButton.Click += this.SaveNewLeadButton_Click; this.NewLeadUniqueValidator.ServerValidate += NewLeadUniqueValidator_ServerValidate; this.SaveLeadRequirementValidator.ServerValidate += this.SaveLeadRequirementValidator_ServerValidate; this.DisplayLeadRadioButtonList.SelectedIndexChanged += this.DisplayLeadRadioButtonList_SelectedIndexChanged; base.OnInit(e); }
protected override void OnInit(EventArgs e) { if (!PermissionController.CanManageJobListingOptions(this)) { this.DenyAccess(); return; } if (AJAX.IsInstalled()) { // AJAX.AddScriptManager(Page); AJAX.WrapUpdatePanelControl(this.LimitOptionPlaceholder, false); this.LimitCheckBox.CheckedChanged += this.LimitCheckBox_CheckedChanged; this.LimitCheckBox.AutoPostBack = true; } this.LimitRangeValidator.MaximumValue = int.MaxValue.ToString(CultureInfo.InvariantCulture); this.Load += this.Page_Load; this.UpdateButton.Click += this.UpdateButton_Click; this.CancelButton.Click += this.CancelButton_Click; base.OnInit(e); }
/// <summary> /// Gets a list of IDs of the job groups which the current user has permission to edit (and therefore to view documents for). /// </summary> /// <returns>A list of IDs for the job groups that the current user can view documents for.</returns> private IList <int?> GetPermissibleJobGroups() { var permissibleJobGroups = new List <int?>(); if (UserInfo.IsSuperUser) { permissibleJobGroups.Add(null); } else { // GetModulesByDefinition's obsolete status was rescinded after DNN 5.0 #pragma warning disable 618 var moduleController = new ModuleController(); foreach (ModuleInfo module in moduleController.GetModulesByDefinition(this.PortalSettings.PortalId, ModuleDefinition.JobListing.ToString())) { #pragma warning restore 618 int?jobGroupId = ModuleSettings.JobGroupId.GetValueAsInt32For(EmploymentController.DesktopModuleName, module, ModuleSettings.JobGroupId.DefaultValue); if (!permissibleJobGroups.Contains(jobGroupId)) { if (PermissionController.CanManageApplications(module)) { permissibleJobGroups.Add(jobGroupId); if (!jobGroupId.HasValue) { // if they have access to the "null" job group, they can see it all, no need to keep looking break; } } } } } return(permissibleJobGroups); }