-
Notifications
You must be signed in to change notification settings - Fork 2
/
AdminReportList.ascx.vb
151 lines (123 loc) · 6.78 KB
/
AdminReportList.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
' --- Copyright (c) notice NevoWeb ---
' Copyright (c) 2008 SARL NevoWeb. www.nevoweb.com. BSD License.
' Author: D.C.Lee, Romain Doidy
' ------------------------------------------------------------------------
' 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 DotNetNuke
Imports DotNetNuke.Common
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Services.Localization
Namespace NEvoWeb.Modules.NB_Store
Partial Public Class AdminReportList
Inherits Framework.UserControlBase
#Region "Private Members"
Private ResourceFile As String
Private _IsEditable As Boolean
Public Property IsEdit() As Boolean
Get
Return _IsEditable
End Get
Set(ByVal value As Boolean)
_IsEditable = value
End Set
End Property
#End Region
Public Event AddButton(ByVal sender As Object, ByVal e As System.EventArgs)
Public Event ReturnButton(ByVal sender As Object, ByVal e As System.EventArgs)
Public Event ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs)
Public Event EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs)
Public Event SearchButton(ByVal sender As Object, ByVal e As System.EventArgs)
Public Sub populateList()
Dim objCtrl As New SQLReportController
If Not _IsEditable Then
cmdAdd.Visible = False
End If
ResourceFile = Services.Localization.Localization.GetResourceFile(Me, Me.GetType().BaseType.Name + ".ascx")
DotNetNuke.Services.Localization.Localization.LocalizeDataGrid(dgReports, ResourceFile)
Dim aryList As ArrayList
aryList = objCtrl.GetSQLAdminReportList(PortalSettings.PortalId, _IsEditable, txtSearch.Text)
dgReports.DataSource = aryList
dgReports.DataBind()
End Sub
'Private Sub dgReports_EditCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgReports.EditCommand
' RaiseEvent EditCommand(source, e)
'End Sub
Private Sub dgReports_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgReports.ItemCommand
Select Case e.CommandName
Case "Copy"
Dim item As DataGridItem = e.Item
Dim ItemId As Integer = Int32.Parse(e.CommandArgument.ToString)
Dim objCtrl As New SQLReportController
objCtrl.CopyReport(ItemId)
End Select
RaiseEvent ItemCommand(source, e)
End Sub
Private Sub dgReports_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgReports.ItemDataBound
If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
Dim objRInfo As NB_Store_SQLReportInfo
Dim imgColumnControl As Control
objRInfo = e.Item.DataItem
imgColumnControl = e.Item.Controls(0).Controls(0)
If TypeOf imgColumnControl Is ImageButton Then
Dim remImage As ImageButton = CType(imgColumnControl, ImageButton)
If Not _IsEditable Then
remImage.Visible = False
End If
End If
imgColumnControl = e.Item.Controls(4).Controls(0)
If TypeOf imgColumnControl Is ImageButton Then
Dim remImage As ImageButton = CType(imgColumnControl, ImageButton)
remImage.Attributes.Add("onClick", "javascript:return confirm('" & Localization.GetString("cmdCopyReport", ResourceFile) & "');")
If Not _IsEditable Then
remImage.Visible = False
End If
End If
If Not objRInfo.AllowExport Then
imgColumnControl = e.Item.Controls(6).Controls(0)
If TypeOf imgColumnControl Is ImageButton Then
Dim remImage As ImageButton = CType(imgColumnControl, ImageButton)
remImage.Visible = False
End If
End If
If Not objRInfo.AllowDisplay Then
imgColumnControl = e.Item.Controls(5).Controls(0)
If TypeOf imgColumnControl Is ImageButton Then
Dim remImage As ImageButton = CType(imgColumnControl, ImageButton)
remImage.Visible = False
End If
End If
imgColumnControl = e.Item.Controls(7).Controls(0)
If TypeOf imgColumnControl Is ImageButton Then
Dim remImage As ImageButton = CType(imgColumnControl, ImageButton)
remImage.Attributes.Add("onClick", "javascript:return confirm('" & Localization.GetString("cmdEmailReport", ResourceFile) & "');")
If Not objRInfo.EmailResults Then
remImage.Visible = False
End If
End If
End If
End Sub
Private Sub dgProducts_PageIndexChanged(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles dgReports.PageIndexChanged
dgReports.CurrentPageIndex = e.NewPageIndex
populateList()
End Sub
Private Sub cmdSearch_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdSearch.Click
dgReports.CurrentPageIndex = 0
RaiseEvent SearchButton(sender, e)
End Sub
Private Sub cmdAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdAdd.Click
RaiseEvent AddButton(sender, e)
End Sub
End Class
End Namespace