-
Notifications
You must be signed in to change notification settings - Fork 0
/
RoleEditor.ascx.vb
47 lines (34 loc) · 1.5 KB
/
RoleEditor.ascx.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Imports System.Linq
Imports Albatros.DNN.Modules.Registration.Entities.Roles
Public Class RoleEditor
Inherits ModuleBase
Private Sub Page_Init(sender As Object, e As System.EventArgs) Handles Me.Init
AddJavascriptFile("albatros.roles.services.js", 70)
rpRoles.DataSource = Settings.RolesToShow.Values
rpRoles.DataBind()
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
DotNetNuke.Framework.jQuery.RequestUIRegistration()
End Sub
Private Sub rpRoles_ItemDataBound(sender As Object, e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rpRoles.ItemDataBound
If (e.Item.ItemType = ListItemType.Item) Or (e.Item.ItemType = ListItemType.AlternatingItem) Then
Dim ctr As Role = CType(e.Item.FindControl("ctrRole"), Role)
ctr.ModuleConfiguration = Me.ModuleConfiguration
ctr.Role = CType(e.Item.DataItem, RegistrationRoleInfo)
End If
End Sub
Private Sub cmdUpdate_Click(sender As Object, e As System.EventArgs) Handles cmdUpdate.Click
For Each itm As RepeaterItem In rpRoles.Items
Dim ctrRole As Role = CType(itm.FindControl("ctrRole"), Role)
ctrRole.Update()
Next
Globals.ClearRolesCache(PortalId)
Settings.ClearCache()
Me.Response.Redirect(DotNetNuke.Common.NavigateURL(), False)
End Sub
Private Sub cmdCancel_Click(sender As Object, e As System.EventArgs) Handles cmdCancel.Click
Globals.ClearRolesCache(PortalId)
Settings.ClearCache()
Me.Response.Redirect(DotNetNuke.Common.NavigateURL(), False)
End Sub
End Class