-
Notifications
You must be signed in to change notification settings - Fork 4
/
SignupViewOptions.ascx.vb
executable file
·154 lines (103 loc) · 5.2 KB
/
SignupViewOptions.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
Imports System.Web.UI.WebControls
Imports DotNetNuke.Common
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Security.Roles
Imports DotNetNuke.Security
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Services.Localization
Imports Ventrian.SubscriptionTools.Entities
Namespace Ventrian.SubscriptionTools
Partial Public Class SignupViewOptions
Inherits ModuleBase
#Region " Private Properties "
Private ReadOnly Property Introduction() As DotNetNuke.UI.UserControls.TextEditor
Get
Return CType(txtIntro, DotNetNuke.UI.UserControls.TextEditor)
End Get
End Property
#End Region
#Region " Private Methods "
Private Sub BindCrumbs()
Dim crumbs As New ArrayList
Dim objCrumbMain As New CrumbInfo
objCrumbMain.Caption = Localization.GetString("Main", LocalResourceFile)
objCrumbMain.Url = NavigateURL()
crumbs.Add(objCrumbMain)
Dim objEditReceipts As New CrumbInfo
objEditReceipts.Caption = Localization.GetString("ViewOptions", LocalResourceFile)
objEditReceipts.Url = EditUrl("ViewOptions")
crumbs.Add(objEditReceipts)
rptBreadCrumbs.DataSource = crumbs
rptBreadCrumbs.DataBind()
End Sub
Private Sub BindCurrency()
Dim ctlList As New Lists.ListController
Dim colCurrency As Lists.ListEntryInfoCollection = ctlList.GetListEntryInfoCollection("Currency", "")
drpCurrency.DataSource = colCurrency
drpCurrency.DataBind()
End Sub
Private Sub BindSettings()
chkAllowMultipleSubscriptions.Checked = Me.AllowMultipleSubscriptions
chkRequireShippingAddress.Checked = Me.RequireShippingAddress
chkUseLiveProcessor.Checked = Me.UseLiveProcessor
txtProcessorUserID.Text = Me.ProcessorUserID
If Not (drpCurrency.Items.FindByValue(Me.Currency) Is Nothing) Then
drpCurrency.SelectedValue = Me.Currency
End If
Introduction.Text = Me.IntroText
chkSendInvoice.Checked = Me.InvoiceSend
txtInvoice.Text = Me.InvoiceTemplate
End Sub
Private Sub SaveSettings()
Dim objModuleController As New ModuleController
objModuleController.UpdateModuleSetting(Me.ModuleId, Constants.ALLOW_MULTIPLE_SUBSCRIPTIONS, chkAllowMultipleSubscriptions.Checked.ToString())
objModuleController.UpdateModuleSetting(Me.ModuleId, Constants.REQUIRE_SHIPPING_ADDRESS, chkRequireShippingAddress.Checked.ToString())
objModuleController.UpdateModuleSetting(Me.ModuleId, Constants.USE_LIVE_PROCESSOR, chkUseLiveProcessor.Checked.ToString())
objModuleController.UpdateModuleSetting(Me.ModuleId, Constants.PROCESSOR_USER_ID, txtProcessorUserID.Text)
objModuleController.UpdateModuleSetting(Me.ModuleId, Constants.CURRENCY, drpCurrency.SelectedValue)
Dim objContentController As New ContentController
Dim objContent As ContentInfo = objContentController.Get(Me.ModuleId, Constants.INTRO_TEXT)
If (objContent Is Nothing) Then
objContent = New ContentInfo
objContent.ModuleID = Me.ModuleId
objContent.SettingName = Constants.INTRO_TEXT
objContent.SettingValue = Introduction.Text
objContentController.Add(objContent)
Else
objContent.SettingValue = Introduction.Text
objContentController.Update(objContent)
End If
objModuleController.UpdateModuleSetting(Me.ModuleId, Constants.INVOICE_SEND, chkSendInvoice.Checked.ToString())
objModuleController.UpdateModuleSetting(Me.ModuleId, Constants.INVOICE_TEMPLATE, txtInvoice.Text)
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
BindCrumbs()
If Not (Page.IsPostBack) Then
BindCurrency()
BindSettings()
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Private Sub cmdUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdUpdate.Click
Try
SaveSettings()
Response.Redirect(NavigateURL(), True)
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Private Sub cmdCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdCancel.Click
Try
Response.Redirect(NavigateURL(), True)
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
#End Region
End Class
End Namespace