-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_element_details.aspx.vb
88 lines (72 loc) · 3.49 KB
/
build_element_details.aspx.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
Imports System.Data
Imports Telerik.Web.UI
Imports System.Data.SqlClient
Partial Class manager_build_element_details
Inherits MyBaseClass
Dim isLocked As Boolean = False
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
' check subscription date and calculate access permissions
Dim subscriptionDate = Session("subscriptionDate")
'Dim paypalPayerId = Session("paypalPayerId").ToString
Dim dateDiff As TimeSpan = DateTime.Today - Convert.ToDateTime(subscriptionDate)
Dim duration As String = dateDiff.TotalDays.ToString
If duration >= 1 Then
' user had a subscription but now expired so just limit their account
'Session("limitedAccount") = True
pLimitedTasks.Visible = True
pTasks.Visible = False
Else
' subscription is valid
'Session("limitedAccount") = False
pLimitedTasks.Visible = False
pTasks.Visible = True
End If
checkPermissions("Project")
End Sub
Protected Sub rntbCompletion_OnTextChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim lblCompletion As Label = fvElementDetails.FindControl("lblCompletion")
lblCompletion.Visible = True
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
hlBack.NavigateUrl = String.Format(hlBack.NavigateUrl, Request.QueryString("pid"))
isLocked = checkLockState()
' output message about lock state
If isLocked Then
panelIsLocked.Visible = True
hlAddTask.Visible = False
Else
panelIsLocked.Visible = False
hlAddTask.Visible = True
End If
Dim activeLink As HyperLink = CType(Master.FindControl("hlProjects"), HyperLink)
activeLink.CssClass = "active"
End Sub
Protected Sub hlAddTask_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim hlAddTask As HyperLink = CType(sender, HyperLink)
hlAddTask.NavigateUrl = String.Format(hlAddTask.NavigateUrl, Request.QueryString("pid"), Request.QueryString("rid"))
End Sub
Protected Function checkLockState() As Boolean
Dim returnVal As Boolean
Dim dvSql As DataView = DirectCast(elementDataSource.Select(DataSourceSelectArguments.Empty), DataView)
For Each drvSql As DataRowView In dvSql
returnVal = Convert.ToBoolean(drvSql("isLocked"))
Next
Return returnVal
End Function
Protected Sub rgCurrentTasks_ItemDeleted(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDeletedEventArgs) Handles rgCurrentTasks.ItemDeleted
fvElementDetails.DataBind()
End Sub
Protected Sub rgCurrentTasks_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles rgCurrentTasks.PreRender
' hide delete action if build element is locked
If isLocked Then
rgCurrentTasks.MasterTableView.Columns(2).Visible = False
End If
End Sub
Protected Sub fvElementDetails_ItemCommand(sender As Object, e As FormViewCommandEventArgs) Handles fvElementDetails.ItemCommand
hideNotification()
End Sub
Protected Sub fvElementDetails_ItemUpdated(sender As Object, e As System.Web.UI.WebControls.FormViewUpdatedEventArgs) Handles fvElementDetails.ItemUpdated
showNotification("Build Element Updated", "Your changes were saved successfully")
completionBar.DataBind()
End Sub
End Class