-
Notifications
You must be signed in to change notification settings - Fork 4
/
BulkEdit.ascx.vb
executable file
·155 lines (101 loc) · 4.22 KB
/
BulkEdit.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
155
'
' Simple Gallery for DotNetNuke - http://www.dotnetnuke.com
' Copyright (c) 2002-2007
' by Ventrian ( [email protected] ) ( http://www.ventrian.com )
'
Imports DotNetNuke.Common
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Services.Localization
Imports Ventrian.SimpleGallery.Entities
Namespace Ventrian.SimpleGallery
Partial Public Class BulkEdit
Inherits SimpleGalleryBase
#Region " Private Members "
Private _albumID As Integer = Null.NullInteger
Private _tagID As Integer = Null.NullInteger
Private _returnUrl As String = Null.NullString
#End Region
#Region " Private Methods "
Private Sub BindBreadCrumbs()
ucGalleryMenu.AddCrumb(Localization.GetString("AllAlbums", LocalResourceFile), NavigateURL())
Dim objAlbumController As New AlbumController
Dim objAlbum As AlbumInfo = objAlbumController.Get(_albumID)
While Not objAlbum Is Nothing
If (GallerySettings.AlbumFilter <> objAlbum.AlbumID.ToString()) Then
ucGalleryMenu.InsertCrumb(1, objAlbum.Caption, NavigateURL(Me.TabId, "", "AlbumID=" & Me.ModuleId.ToString() & "-" & objAlbum.AlbumID.ToString()))
End If
If (objAlbum.ParentAlbumID = Null.NullInteger) Then
objAlbum = Nothing
Else
objAlbum = objAlbumController.Get(objAlbum.ParentAlbumID)
End If
End While
ucGalleryMenu.AddCrumb(Localization.GetString("EditPhotos", Me.LocalResourceFile), EditUrl("AlbumID", _albumID.ToString(), "BulkEdit"))
End Sub
Private Sub BindPhotos()
ucEditPhotos.AlbumID = _albumID
ucEditPhotos.TagID = _tagID
ucEditPhotos.BindPhotos()
End Sub
Private Sub ReadQueryString()
If Not (Request("AlbumID") Is Nothing) Then
_albumID = Convert.ToInt32(Request("AlbumID"))
End If
If Not (Request("ReturnUrl") Is Nothing) Then
_returnUrl = Request("ReturnUrl")
End If
If Not (Request("TagID") Is Nothing) Then
_tagID = Convert.ToInt32(Request("TagID"))
End If
End Sub
Private Sub SavePhotos()
ucEditPhotos.Save()
If (_returnUrl <> "") Then
Response.Redirect(_returnUrl, True)
Else
Response.Redirect(NavigateURL(), True)
End If
End Sub
Private Sub SecurityCheck()
If (Me.HasEditPhotoPermissions) = False Then
Response.Redirect(NavigateURL, True)
End If
End Sub
#End Region
#Region " Protected Methods "
#End Region
#Region " Event Handlers "
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
SecurityCheck()
ReadQueryString()
BindBreadCrumbs()
If (Page.IsPostBack = False) Then
BindPhotos()
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Private Sub imgSave_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgSave.Click
Try
If (Page.IsValid) Then
SavePhotos()
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Private Sub cmdSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSave.Click
Try
If (Page.IsValid) Then
SavePhotos()
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
#End Region
End Class
End Namespace