-
Notifications
You must be signed in to change notification settings - Fork 2
/
MenuManager.ascx.vb
127 lines (98 loc) · 5.39 KB
/
MenuManager.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
' --- Copyright (c) notice NevoWeb ---
' Copyright (c) 2008 SARL NevoWeb. www.nevoweb.com. BSD License.
' Author: D.C.Lee
' ------------------------------------------------------------------------
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
' DEALINGS IN THE SOFTWARE.
' ------------------------------------------------------------------------
' This copyright notice may NOT be removed, obscured or modified without written consent from the author.
' --- End copyright notice ---
Imports System.Web.UI
Imports System.Collections.Generic
Imports System.Reflection
Imports System.Data
Imports System.Xml
Imports DotNetNuke
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Services.Localization
Imports NEvoWeb.Modules.NB_Store.SharedFunctions
Namespace NEvoWeb.Modules.NB_Store
''' -----------------------------------------------------------------------------
''' <summary>
''' The MenuManager class displays the content
''' </summary>
''' <remarks>
''' </remarks>
''' <history>
''' </history>
''' -----------------------------------------------------------------------------
Partial Class MenuManager
Inherits BaseModule
Implements Entities.Modules.IPortable
#Region "Event Handlers"
''' -----------------------------------------------------------------------------
''' <summary>
''' Page_Load runs when the control is loaded
''' </summary>
''' <remarks>
''' </remarks>
''' <history>
''' </history>
''' -----------------------------------------------------------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim objSCtrl As New SettingsController
Dim errMsg As String = ""
Dim objUpg As New Upgrade
Dim StorePortalVerison As String = GetStoreSetting(PortalId, "version", "None")
If StorePortalVerison = "" Then
'No version so do First time install
'check the product images and doc directories exist.
CreateDir(PortalSettings, PRODUCTIMAGESFOLDER)
CreateDir(PortalSettings, PRODUCTDOCSFOLDER)
'copy noimage to portal root
Try
Dim objR As New ImgReSize
'Use this method to try and get over medium trust issues
FileSystemUtils.SaveFile(PortalSettings.HomeDirectoryMapPath & "noimage.png", objR.BmpToBytes_MemStream(EmbeddedImage("noimage.png"), 72, 4))
Catch ex As Exception
'do nothing
End Try
errMsg = objUpg.DoUpgrade(PortalId, StoreInstallPath, UserId)
End If
If VersionCompare(StorePortalVerison, ModuleConfiguration.DesktopModule.Version) <> 0 Then
errMsg = objUpg.DoUpgrade(PortalId, StoreInstallPath, UserId)
End If
'Check the store setting were upgraded.
StorePortalVerison = GetStoreSetting(PortalId, "version", "None")
If VersionCompare(StorePortalVerison, ModuleConfiguration.DesktopModule.Version) <> 0 Then
errMsg = "NB_Store Portal Version " & StorePortalVerison & " mismatch with NB_Store Module Version " & ModuleConfiguration.DesktopModule.Version
End If
If errMsg <> "" Then
PlaceHolder1.Controls.Add(New LiteralControl(System.Web.HttpUtility.HtmlDecode("<br />" & errMsg)))
End If
'----------------------------------------------------------
DisplayMsgText(PortalId, PlaceHolder1, "backoffice.text", "")
Me.Controls.Add(New AdminMenu)
If GetStoreSettingBoolean(PortalId, "orderedit.flag") Then
' This is to stop orders that have been edited continuing to be linked to a cart cookie.
CurrentCart.DeleteCart(PortalId)
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
#End Region
#Region "Optional Interfaces"
Public Function ExportModule(ByVal ModuleID As Integer) As String Implements Entities.Modules.IPortable.ExportModule
' included as a stub only so that the core knows this module Implements Entities.Modules.IPortable
End Function
Public Sub ImportModule(ByVal ModuleID As Integer, ByVal Content As String, ByVal Version As String, ByVal UserID As Integer) Implements Entities.Modules.IPortable.ImportModule
' included as a stub only so that the core knows this module Implements Entities.Modules.IPortable
End Sub
#End Region
End Class
End Namespace