-
Notifications
You must be signed in to change notification settings - Fork 0
/
delegate.asp
58 lines (50 loc) · 1.93 KB
/
delegate.asp
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
<!--#include virtual="/eVacation/common/appglobal.asp" -->
<%
strCurrentPageName = "Delegate"
'**** INITIALISE CURRENT USER AND EE TO VIEW OBJECTS ****
mInitialiseCurrentUser
Dim loclngSaveResult
Dim locblnValidate
If not objCurrentUser.IsManager then
mCloseApplication
response.redirect CONST_APPLICATION_PATH & "/usererror.asp?error=" & CONST_USER_NOT_ALLOWED_TO_DELEGATE
End If
mWriteHMTLTop strCurrentPageName
mWriteNavBar strCurrentPageName
locblnValidate = False
If request.form("formname") = "frmRemoveDelegate" then
loclngSaveResult = objCurrentUser.RemoveDelegate()
if loclngSaveResult = 0 then
mWriteGeneralError "Sorry - an error has occurred while attempting to remove your delegate.<br>" & _
"There may be a problem with the network, or the database server may be experiencing difficulties.", False
else
response.write "<center>"
response.write "<br>"
response.write "<b>Your delegate has been removed successfully.</b><br>"
response.write "<br>"
response.write "</center>"
End If
ElseIf request.form("formname") = "frmAppointDelegate" then
objCurrentUser.LoadDelegateFromForm
If objCurrentUser.DelegateFormIsValid then
loclngSaveResult = objCurrentUser.Save()
If loclngSaveResult = 0 then
mWriteGeneralError "Sorry - an error has occurred while attempting to appoint your delegate.<br>" & _
"There may be a problem with the network, or the database server may be experiencing difficulties.", False
else
response.write "<center>"
response.write "<br>"
response.write "<b>You have successfully appointed "
response.write objCurrentUser.ActiveDelegate.FullName
response.write " as your delegate.</b><br>"
response.write "<br>"
response.write "</center>"
End If
Else
locblnValidate = True
End If
End If
mWriteDelegateForm objCurrentUser, locblnValidate
mWritePageFooter
%>
<!--#include virtual="/eVacation/common/appglobalend.asp" -->