-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListDenda.aspx.vb
More file actions
37 lines (28 loc) · 1.23 KB
/
ListDenda.aspx.vb
File metadata and controls
37 lines (28 loc) · 1.23 KB
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
Partial Class ListDenda
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Context.Session("USERNAME") Is Nothing Then
Response.Redirect("Logout.aspx?mode=expired")
End If
PopulateData()
End Sub
Private Sub PopulateData()
Dim username = Context.Session("USERNAME").ToString()
If String.IsNullOrEmpty(username) Then
Response.Redirect("Login.aspx")
Return
End If
Dim role = Context.Session("USERROLE").ToString()
If role.ToLower().Equals("admin") Then
AccessDataSource2.SelectCommand = "SELECT * FROM [denda] ORDER BY [TglDenda]"
Else
AccessDataSource2.SelectCommand = "SELECT * FROM [denda] WHERE username = '" & username & "' ORDER BY [TglDenda]"
End If
End Sub
Protected Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As GridViewPageEventArgs) Handles GridView1.PageIndexChanging
PopulateData()
End Sub
Protected Sub GridView1_SelectedIndexChanging(ByVal sender As Object, ByVal e As GridViewSelectEventArgs) Handles GridView1.SelectedIndexChanging
End Sub
End Class