-
Notifications
You must be signed in to change notification settings - Fork 4
/
StatusEditRole.ascx.vb
executable file
·119 lines (87 loc) · 4.02 KB
/
StatusEditRole.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Imports DotNetNuke
Imports DotNetNuke.Common
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Services.Exceptions
Imports Ventrian.SubscriptionTools.Entities
Namespace Ventrian.SubscriptionTools
Partial Public Class StatusEditRole
Inherits PortalModuleBase
#Region " Private Members "
Private _roleName As String = Null.NullString
#End Region
#Region " Private Properties "
Private ReadOnly Property Content() As DotNetNuke.UI.UserControls.TextEditor
Get
Return CType(teContent, DotNetNuke.UI.UserControls.TextEditor)
End Get
End Property
#End Region
#Region " Private Methods "
Private Sub ReadQueryString()
If Not (Request("Role") Is Nothing) Then
_roleName = Request("Role")
End If
End Sub
#End Region
#Region "Event Handlers"
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
ReadQueryString()
If Page.IsPostBack = False Then
Dim objContentController As New ContentController
Dim objContentInfo As New ContentInfo
objContentInfo = objContentController.Get(Me.ModuleId, _roleName.ToString())
If Not (objContentInfo Is Nothing) Then
Content.Text = objContentInfo.SettingValue
End If
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Private Sub cmdCancel_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdCancel.Click
Try
Response.Redirect(EditUrl("ViewOptions"), True)
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Private Sub cmdUpdate_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cmdUpdate.Click
Try
Dim objContentController As New ContentController
Dim objContentInfo As New ContentInfo
objContentInfo = objContentController.Get(Me.ModuleId, _roleName.ToString())
If (objContentInfo Is Nothing) Then
objContentInfo = New ContentInfo
objContentInfo.ModuleID = Me.ModuleId
objContentInfo.SettingName = _roleName.ToString()
objContentInfo.SettingValue = Content.Text
objContentController.Add(objContentInfo)
Else
objContentInfo.ModuleID = Me.ModuleId
objContentInfo.SettingName = _roleName.ToString()
objContentInfo.SettingValue = Content.Text
objContentController.Update(objContentInfo)
End If
Response.Redirect(EditUrl("ViewOptions"), True)
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Private Sub cmdClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdClear.Click
Try
Dim objContentController As New ContentController
Dim objContentInfo As ContentInfo = objContentController.Get(Me.ModuleId, _roleName.ToString())
If Not (objContentInfo Is Nothing) Then
objContentInfo.SettingValue = ""
objContentController.Update(objContentInfo)
End If
Response.Redirect(EditUrl("ViewOptions"), True)
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
#End Region
End Class
End Namespace