Hi,
I'm getting the following error on my ASP Page:
Request object error 'ASP 0104 : 80004005'
Operation not Allowed
/ScriptLibrary/incPureUplo
ad.asp, line 40
The reason for this that I found on the net is :
Pure ASP Upload supports uploading large files on the Windows 2003 server. However:
IIS6.0 prevent the upload of files more than +200Kb. So you need to make some changes in the default IIS settings first.
Background
For IIS6.0 users, the AspMaxRequestEntityAllowed
property specifies the maximum number of bytes allowed in the entity body of an ASP request. If a Content-Length header is present and specifies an amount of data greater than the value of AspMaxRequestEntityAllowed
, IIS returns a 403 error response.
This property is related in function to MaxRequestEntityAllowed, but is specific to ASP request. Whereas you might set the MaxRequestEntityAllowed property to 1 MB at the general World Wide Web Publishing Service (WWW Service) level, you may choose to set AspMaxRequestEntityAllowed
to a lower value, if you know that your specific ASP applications handle a smaller amount of data.
Solution
Open your metabase.XML which is located in c:\Windows\System32\Inetsr
v find the line "AspMaxRequestEntityAllowe
d" and change it to "1073741824". This is 1GB - of course you can enter another value to suite your needs.
I want to reduce the size of my ASP page so that my page loads faster also.....or convert my code so that it becomes more optimized.
It is very slow on the click of the radio button rdoDateFormat. I am pasting the code for the entire page again.
Can somebody help me with this?
Thanks!
<%@ Language=VBScript %>
<%Response.Buffer=True
Response.Expires=0
server.ScriptTimeout = 150
%>
<!--#include File=include\DBAccess.asp-
->
<!--#include File=include\security.asp-
->
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft FrontPage 5.0">
<!-- Bug#6357 v-yashk 05/27/2003 Inline display of calender control using Div-->
<!-- Bug#6631 v-yashk 05/28/2003 -- Aligning headers -->
<STYLE>
<!--
Div.PopCal
{ position: absolute;
left: 40px;
top: 60px;
display: none;
Border:thin;
z-Index=1
}
BODY.Calendar
{
BACKGROUND-COLOR: #eeeecc;
COLOR: black;
FONT-FAMILY: Arial, Verdana, Sans-Serif;
MARGIN: 0px;
PADDING-BOTTOM: 0px;
PADDING-LEFT: 0px;
PADDING-RIGHT: 0px;
PADDING-TOP: 0px
}
Table.Calender
{
width:225px;
height:175px;
BACKGROUND-COLOR: #eeeeff;
Border:1px none Blue;
}
TH.CalendarHeader
{
BACKGROUND-COLOR: #eeeecc;
COLOR: black;
FONT-FAMILY: Arial, Verdana, Sans-Serif;
FONT-SIZE: 10pt;
FONT-WEIGHT: bold;
TEXT-DECORATION: none
}
TH.CalendarForward
{
BACKGROUND-COLOR: #eeeecc;
COLOR: blue;
CURSOR: hand;
FONT-FAMILY: Arial, Verdana, Sans-Serif;
FONT-SIZE: 10pt;
FONT-WEIGHT: bold;
TEXT-ALIGN: right;
TEXT-DECORATION: none
}
TH.CalendarBack
{
BACKGROUND-COLOR: #eeeecc;
COLOR: blue;
CURSOR: hand;
FONT-FAMILY: Arial, Verdana, Sans-Serif;
FONT-SIZE: 10pt;
FONT-WEIGHT: bold;
TEXT-ALIGN: left;
TEXT-DECORATION: none
}
TD.CalendarDayHeader
{
BACKGROUND-COLOR: black;
COLOR: white;
FONT-FAMILY: Arial, Verdana, Sans-Serif;
FONT-SIZE: 8pt;
FONT-WEIGHT: bold;
TEXT-ALIGN: center;
TEXT-DECORATION: none
}
TD.CalendarDate
{
BACKGROUND-COLOR: #eeeecc;
COLOR: black;
CURSOR: hand;
FONT-FAMILY: Arial, Verdana, Sans-Serif;
FONT-SIZE: 10pt;
FONT-WEIGHT: bold;
TEXT-ALIGN: center;
TEXT-DECORATION: none
}
TD.CalendarDateToday
{
BACKGROUND-COLOR: #cccccc;
COLOR: black;
CURSOR: hand;
FONT-FAMILY: Arial, Verdana, Sans-Serif;
FONT-SIZE: 10pt;
FONT-WEIGHT: bold;
TEXT-ALIGN: center;
TEXT-DECORATION: none
}
TD.TDDate
{
font-family : Times New Roman;
font-size : 8pt
}
Select.SelectStyle
{
font-family : Times New Roman;
font-size : 8pt
}
Input.TxtDate
{
font-family : Times New Roman;
font-size : 8pt;
WIDTH: 60px;
HEIGHT: 24px
}
-->
</STYLE>
<script LANGUAGE="vbscript">
dim aryDateFields
aryDateFields = Array("OriginalReceivedDat
e", "MSSignedDate", "CustomerSignedDate", "DateSentTOMSSigner", "DateReceivedFromMSSigner"
,"DateReje
ctedByMSSi
gner", "SentToAccountingDate", "SentToLegalDate", "SenttoAdminDate", "ShipDate")
' [START] Bug#6357 v-yashk 05/27/2003 Inline display of calender control using Div
dim SourceId
' Set Up Global Variables
Dim vMonth
Dim vYear
Dim vMonthDesc(12)
Dim vReturnDiv
Dim vReturnTextBox
Dim vDay
dim vDate
' Set Up Long Month Names
vMonthDesc(1) = "January"
vMonthDesc(2) = "February"
vMonthDesc(3) = "March"
vMonthDesc(4) = "April"
vMonthDesc(5) = "May"
vMonthDesc(6) = "June"
vMonthDesc(7) = "July"
vMonthDesc(8) = "August"
vMonthDesc(9) = "September"
vMonthDesc(10) = "October"
vMonthDesc(11) = "November"
vMonthDesc(12) = "December"
sub calpopup(strId)
SourceId = "txt" & strId
dim tempX, tempY
tempX = window.event.clientX + document.body.scrollLeft
tempY = window.event.clientY + document.body.scrollTop
dim objPopCal, objSource
'Popup calender
set objPopCal = Document.all.PopCal
'source textbox which caused control to popup
set objSource = Document.all(SourceId)
if trim(objSource.value) <> "" then
call SetCalenderDate(ConvertDat
eFormat(ob
jSource.va
lue))
else
call SetCalenderDate(objSource.
value)
end if
dim myclientHeight, myclientWidth
myclientHeight = document.body.clientHeight
myclientWidth = document.body.clientWidth
if tempX + 225 <= 720 then 'to avoid combo box overlap
objPopCal.style.left = tempX
else
objPopCal.style.left = (720 - 225) 'to avoid combo box overlap
end if
if tempY + 175 <= myclientHeight then
objPopCal.style.top = tempY
else
objPopCal.style.top = tempY - 175
end if
objPopCal.style.display= "inline"
end sub
Sub ChooseDate(vCellID)
' If the user clicked on a valid date
If IsDate(CStr(vMonth) & "/" & document.all.item(vCellID)
.innerText
& "/" & CStr(vYear)) Then
' Place the date in the corresponding Text Box
dim tdate, NewDate
' [START] Bug#6943 v-reenag 11/18/2003
'for date format
'tdate = Left(vmonthDesc(vMonth),3)
& " " & document.all.item(vCellID)
.innerText
& "," & CStr(vYear)
If document.all.CurrentDateFo
rmat.value
= "mm/dd/yyyy" then
NewDate = CStr(vMonth) & "/" & document.all.item(vCellID)
.innerText
& "/" & CStr(vYear)
else
NewDate = document.all.item(vCellID)
.innerText
& "/" & CStr(vMonth) & "/" & CStr(vYear)
end if
'NewDate = ConvertDateFormat(formatda
tetime(tda
te, 2))
' [END] Bug#6943 v-reenag 11/18/2003
document.all(SourceId).val
ue = NewDate
Document.all.PopCal.style.
display = "none"
End If
End Sub
' [START] Bug#6836 v-reenag 11/14/2003 Removing the parameter, iOption
Function ConvertDateFormat(sInput)
Dim sTemp, sDate
sTemp = Split(sInput, "/")
'if iOption = 0 then
sDate = sTemp(1) & "/" & sTemp(0) & "/" & sTemp(2)
'else
' sDate = sTemp(0) & "/" & sTemp(1) & "/" & sTemp(2)
'end if
ConvertDateFormat = sDate
End Function
' [END] Bug#6836 v-reenag 11/14/2003
Sub ForwardMonth()
' Advance to the Next Month
If vMonth < 12 Then
vMonth = vMonth + 1
Else
vYear = vYear + 1
vMonth = 1
End If
' Refresh the Calendar
RefreshCalendar
End Sub
Sub BackMonth()
' Go back to the Previous Month
If vMonth > 1 Then
vMonth = vMonth - 1
Else
vYear = vYear - 1
vMonth = 12
End If
' Refresh the Calendar
RefreshCalendar
End Sub
Sub RefreshCalendar()
Dim vOffSet ' Number of blank days before the first of the month
Dim MyCell ' Used as a reference to speed processing
' Calculate offset
vOffSet = 1 - Weekday(DateSerial(vYear, vMonth, 1))
' Update Header of Month and Year
CalHeader.innerText = vMonthDesc(vMonth) & " " & CStr(vYear)
' Update Date Cells
For i = 1 To 37
' Create Cell Reference
Set MyCell = document.all.item("Cell_" & CStr(i))
' If this is a valid date
If IsDate(CStr(vMonth) & "/" & CStr(vOffSet + i) & "/" & CStr(vYear)) Then
' Change mouse pointer
MyCell.style.cursor = "hand"
' Place the date in the cell
MyCell.innerText = CStr(vOffSet + i)
' Assign the approproiate class
'If CInt(vMonth) = Month(Now()) And CInt(vOffSet + i) = CInt(vDay) And CInt(vYear) = Year(Now()) Then
' If this is Today
MyCell.className = "CalendarDate"
If CInt(vOffSet + i) = CInt(vDay) Then
MyCell.className = "CalendarDateToday"
end if
'Else
' If this is not Today
' MyCell.className = "CalendarDate"
'End If
Else
' If it's not a valid date
MyCell.style.cursor = "default"
MyCell.style.zindex = 500
MyCell.className = "CalendarDate"
MyCell.innerHTML = " "
End If
Set MyCell = Nothing
Next
End Sub
Sub SetCalenderDate(DefaultDat
e)
on error resume next
If not isDate(DefaultDate) Then
vMonth = Month(Now())
vYear = Year(Now())
vDay = day(now())
Else
vDate = cstr(DefaultDate)
vMonth = Month(vDate)
vYear = Year(vDate)
vDay = Day(vDate)
End if
' Set Initial Values
RefreshCalendar
End Sub
' [END] Bug#6357
sub txt_onkeydown(MyControlNam
e)
dim total_rows
total_rows = cInt(document.all.item("to
talrows").
value)
dim iVal, sTemp, TargetControlName
sTemp = split(MyControlName,"_")
iVal = cInt(sTemp(1))
dim iNextRowId
if window.event.keyCode = 38 then
iNextRowId = ival - 1
if iNextRowId < 1 then
exit sub
else
TargetControlName = sTemp(0) & "_" & iNextRowId
document.AgreementPostRout
ingInfoLis
t(TargetCo
ntrolName)
.focus()
end if
elseif window.event.keyCode = 40 then
iNextRowId = ival + 1
if iNextRowId > total_rows then
exit sub
else
TargetControlName = sTemp(0) & "_" & iNextRowId
document.AgreementPostRout
ingInfoLis
t(TargetCo
ntrolName)
.focus()
end if
else
window.event.returnValue=t
rue
end if
end sub
' [START] Bug#6836 v-reenag 11/14/2003 Removing the parameter iOption and adding sDateformat to avoid
'changing of date format when already selected date format is clicked again.
sub ChangeDateFormat(sDateForm
at)
If document.all.CurrentDateFo
rmat.value
<> sDateFormat then
'This function changes date format in all the textboxes
DateFormat.Style.Display = "inline"
dim total_rows, iAryCount
total_rows = document.all.item("totalro
ws").value
' [START] Bug#6836 v-reenag 11/04/2003 Commenting the If condition
'if iOption <> document.all.dateformatcha
nged.value
then
'Date format has been changed and all the date textboxes should be updated
dim icnt, sInput
for icnt = 1 to total_rows
for iAryCount = 0 to UBOUND(aryDateFields)
' [START] Bug#6814 v-reenag 10/07/2003 Writing the If condition
if Not document.all.item("txt" & aryDateFields(iAryCount) & "_" + cstr(icnt)) Is Nothing then
sInput = document.all.item("txt" & aryDateFields(iAryCount) & "_" + cstr(icnt)).value
if isDate(sInput) = True then
document.all.item("txt" & aryDateFields(iAryCount) & "_" + cstr(icnt)).value = ConvertDateFormat(sInput)
end if
end if
' [END] Bug#6814 v-reenag 10/07/2003
next
next
'document.all.dateformatch
anged.valu
e = iOption
'end if
' [END] Bug#6836 v-reenag 11/04/2003
DateFormat.Style.Display = "none"
end if
document.all.CurrentDateFo
rmat.value
= sDateFormat
end sub
' [END] Bug#6836 v-reenag 11/14/2003
function ValidateMe()
'This function changes date format in all the textboxes
dim total_rows
total_rows = document.all.item("totalro
ws").value
dim icnt, iAryCount
for icnt = 1 to total_rows
for iAryCount = LBound(aryDateFields) to UBOUND(aryDateFields)
' [START] Bug#6943 v-reenag 11/12/2003 Writing the If condition
if Not document.all.item("txt" & aryDateFields(iAryCount) & "_" + cstr(icnt)) Is Nothing then
sInput = document.all.item("txt" & aryDateFields(iAryCount) & "_" + cstr(icnt)).value
if sInput <> "" then
if isDate(sInput) = false then
window.alert("Invalid value for " & aryDateFields(iAryCount))
document.all.item("txt" & aryDateFields(iAryCount) & "_" + cstr(icnt)).focus()
exit function
end if
end if
end if
' [END] Bug#6943 v-reenag
next
next
'Since validation is successful, Now submit the form
dim sCompanyCode
sCompanyCode = document.AgreementPostRout
ingInfoLis
t.CompanyC
ode.value
document.AgreementPostRout
ingInfoLis
t.action = "AgreementPostRoutingInfoL
ist.asp?Co
mpanyCode=
" & sCompanyCode
document.AgreementPostRout
ingInfoLis
t.method = "post"
document.AgreementPostRout
ingInfoLis
t.submit()
end function
'[START] LW2.8 Bug 6836 v-reenag 14/14/2003 : Commenting the vbscript function, writing it in Java Script
'sub Initialise()
'[START] LW2.8 Req. E6 v-reenag 09/14/2003 : Commenting the code to select a date format
'document.all.rdoDateForma
t(1).check
ed = true
'[END] LW2.8 Req. E6 v-reenag 09/14/2003
' Progress.Style.Display = "none"
'PageHeader.style.display=
"inline"
'oDiv.style.display="inlin
e"
'end sub
'[END] LW2.8 Bug 6836 v-reenag 14/14/2003
</script>
</head>
<BODY onload="Initialise()">
<form name="AgreementPostRouting
InfoList" method="Post" action="AgreementPostRouti
ngInfoList
.asp">
<span name="Progress" id="Progress" Style="Display:inline">
<img name=ProgBar src=/images/waitingarrow.g
if>
</span><P>
<%
'Response.Flush
'[START] LW2.8 Req. E6 v-reenag 09/14/2003 : Getting the user's preferred date format
'[START] Bug 6941 E6 v-reenag 11/18/2003 : Getting the current user
Dim aUser
aUser = Split(Request.servervariab
les("AUTH_
USER"), "\")
Session("EmailAlias") = aUser(UBound(aUser))
gsEmailAlias = aUser(UBound(aUser))
'[END] Bug 6941 E6 v-reenag 11/18/2003
Function GetUserDateFormat(sEmailAl
ias)
Dim sSQL
Dim rs
Const SQL_GetUserDateFormat = "Execute usp_GetUserDateFormat '@EMailAlias'"
sSQL = Replace(SQL_GetUserDateFor
mat, "@EMailAlias", sEmailAlias)
if not getRecordset(sSQL, rs) then
Response.Write GetLastDBError
Response.End
end if
set GetUserDateFormat = rs
End Function
Dim rsDateFormat
set rsDateFormat = GetUserDateFormat(gsEmailA
lias)
'[END] LW2.8 Req. E6 v-reenag 09/14/2003
'[START] LW2.8 Req. E6 v-reenag 09/14/2003 : Getting the current date format in a variable
Dim sCurrentDateFormat
sCurrentDateFormat = Request("CurrentDateFormat
")
if sCurrentDateFormat = "" then
sCurrentDateFormat = rsDateFormat("UserDateForm
at")
end if
'[END] LW2.8 Req. E6 v-reenag 09/14/2003
dim rsAgreement, rsShippedVia, sSQLShip, sSQL, sSQL1
'This part needs to run before and after posting to refresh data
dim sCompanyCode
sCompanyCode = Cstr(Request.QueryString("
CompanyCod
e"))
sSQL = "Exec USP_GetAgreementListforPos
tRoutingIn
fo " & cstr(sCompanyCode)
if not getRecordset(sSQL, rsAgreement) then
Response.Write GetLastDBError
Response.End
end if
'For shipping medium
sSQLShip = "Exec sp_GetShippedVia"
if not getRecordset(sSQLShip, rsShippedVia) then
Response.Write GetLastDBError
Response.End
end if
'[START] LW2.8 Bug 6836 v-reenag 14/14/2003 : Removing the hidden field dateformatchanged
'because default format is not necessarily mm/dd/yy
'To check if date format has been changed from default mm/dd/yy
'dim iDateFormatChanged
'iDateFormatChanged = Request.Form("dateformatch
anged")
'[END] LW2.8 Bug 6836 v-reenag 14/14/2003
'This part is used only when the page is posted
if Request.Form("flag") <> "" then
Call UpdateData
'Load updated data again from the database
if not getRecordset(sSQL, rsAgreement) then
Response.Write GetLastDBError
Response.End
end if
end if
Sub UpdateData()
'Iterate the table and save those row data where checkbox is clicked
dim iCurrentRow, iRows, iAgreementId
iRows = Cint(Request.Form("totalro
ws"))
'Begin transaction
call BeginTran
for iCurrentRow = 1 to iRows
'Find record which have been changed
iAgreementId = CLng(Request.Form("hdAgree
mentId_" & cstr(iCurrentRow)))
rsAgreement.Find "AgreementId=" & iAgreementId
if Not rsAgreement.EOF then
dim iDataChanged
iDataChanged = 0
OriginalReceivedDate = Request.Form("txtOriginalR
eceivedDat
e" & "_" & cstr(iCurrentRow))
iDataChanged = iDataChanged + HasDataChanged(OriginalRec
eivedDate,
rsAgreement.fields("Origin
alReceived
Date").val
ue)
MSSignedDate = Request.Form("txtMSSignedD
ate" & "_" & cstr(iCurrentRow))
iDataChanged = iDataChanged + HasDataChanged(MSSignedDat
e, rsAgreement.fields("MSSign
edDate").v
alue)
CustomerSignedDate = Request.Form("txtCustomerS
ignedDate"
& "_" & cstr(iCurrentRow))
iDataChanged = iDataChanged + HasDataChanged(CustomerSig
nedDate, rsAgreement.fields("Custom
erSignedDa
te").value
)
DateSentTOMSSigner = Request.Form("txtDateSentT
OMSSigner"
& "_" & cstr(iCurrentRow))
iDataChanged = iDataChanged + HasDataChanged(DateSentTOM
SSigner, rsAgreement.fields("DateSe
ntTOMSSign
er").value
)
DateReceivedFromMSSigner = Request.Form("txtDateRecei
vedFromMSS
igner" & "_" & cstr(iCurrentRow))
iDataChanged = iDataChanged + HasDataChanged(DateReceive
dFromMSSig
ner, rsAgreement.fields("DateRe
ceivedFrom
MSSigner")
.value)
DateRejectedByMSSigner = Request.Form("txtDateRejec
tedByMSSig
ner" & "_" & cstr(iCurrentRow))
iDataChanged = iDataChanged + HasDataChanged(DateRejecte
dByMSSigne
r, rsAgreement.fields("DateRe
jectedByMS
Signer").v
alue)
SentToAccountingDate = Request.Form("txtSentToAcc
ountingDat
e" & "_" & cstr(iCurrentRow))
iDataChanged = iDataChanged + HasDataChanged(SentToAccou
ntingDate,
rsAgreement.fields("SentTo
Accounting
Date").val
ue)
SentToLegalDate = Request.Form("txtSentToLeg
alDate" & "_" & cstr(iCurrentRow))
iDataChanged = iDataChanged + HasDataChanged(SentToLegal
Date, rsAgreement.fields("SentTo
LegalDate"
).value)
SenttoAdminDate = Request.Form("txtSenttoAdm
inDate" & "_" & cstr(iCurrentRow))
iDataChanged = iDataChanged + HasDataChanged(SenttoAdmin
Date, rsAgreement.fields("Sentto
AdminDate"
).value)
ShipDate = Request.Form("txtShipDate"
& "_" & cstr(iCurrentRow))
iDataChanged = iDataChanged + HasDataChanged(ShipDate, rsAgreement.fields("ShipDa
te").value
)
MSSignerEmailAlias = Request.Form("txtMSSignerE
mailAlias"
& "_" & cstr(iCurrentRow))
if IsNULL(rsAgreement.fields(
"MSSignerE
mailAlias"
).value) then
if MSSignerEmailAlias <> "" then
iDataChanged = iDataChanged + 1
end if
else
if MSSignerEmailAlias <> rsAgreement.fields("MSSign
erEmailAli
as").value
then
iDataChanged = iDataChanged + 1
end if
end if
if Request.form("selShippedVi
aID" & "_" & cstr(iCurrentRow)) <> "NULL" then
ShippedViaID = Cint(Request.form("selShip
pedViaID" & "_" & cstr(iCurrentRow)))
else
ShippedViaID = "NULL"
end if
if IsNULL(rsAgreement.fields(
"ShippedVi
aID").valu
e) then
PrevShippedViaID = "NULL"
else
PrevShippedViaID = Cint(rsAgreement.fields("S
hippedViaI
D").value)
end if
if ShippedViaID <> PrevShippedViaID then
iDataChanged = iDataChanged + 1
end if
ShipID = Request("txtShipID" & "_" & cstr(iCurrentRow))
if ISNULL(rsAgreement.fields(
"ShipID").
value) then
if ShipId <> "" then
iDataChanged = iDataChanged + 1
end if
else
if ShipID <> rsAgreement.fields("ShipID
").value then
iDataChanged = iDataChanged + 1
end if
end if
if iDataChanged > 0 then
'Save data
if SaveRecord(iAgreementId, OriginalReceivedDate, MSSignedDate, CustomerSignedDate, DateSentTOMSSigner, DateReceivedFromMSSigner, MSSignerEmailAlias, DateRejectedByMSSigner, SentToAccountingDate, SentToLegalDate, SenttoAdminDate, ShipDate, ShippedViaID, ShipID) = false then
Response.End
end if
end if
if SaveUserDateFormat() = false then
Response.End
end if
end if
next
Call Commit
end sub
function HasDataChanged(ChangedVal,
OriginalVal)
'Database value might be null
if not isNull(OriginalVal) then
OriginalVal = FormatDateTime(OriginalVal
,2)
else
OriginalVal = ""
end if
'If date format is dd/mm/yy then change it to mm/dd/yy before sending to database
'[START] LW2.8 Req. E6 v-reenag 14/14/2003 : Replacing iDateFormatChanged = 0 by
'sCurrentDateFormat = "dd/mm/yyyy" for readability
if sCurrentDateFormat = "dd/mm/yyyy" and ChangedVal <> "" then
Dim sTemp
sTemp = Split(ChangedVal, "/")
ChangedVal = sTemp(1) & "/" & sTemp(0) & "/" & sTemp(2)
end if
'[END] LW2.8 Req. E6 v-reenag 14/14/2003
'compare values to find if it has changed
if ChangedVal <> OriginalVal then
HasDataChanged = 1
else
HasDataChanged = 0
end if
end function
Function SaveRecord(iAgreementId, OriginalReceivedDate, MSSignedDate, CustomerSignedDate, DateSentTOMSSigner, DateReceivedFromMSSigner, MSSignerEmailAlias, DateRejectedByMSSigner, SentToAccountingDate, SentToLegalDate, SenttoAdminDate, ShipDate, ShippedViaID, ShipID)
dim sSQL, rsUpdate, bFlag
sSQL = "Exec usp_SaveAgreementListforPo
stRoutingI
nfo "
sSQL = sSQL & iAgreementId & ", "
if OriginalReceivedDate <> "" then
sSQL = sSQL & "'" & OriginalReceivedDate & "', "
else
sSQL = sSQL & "NULL, "
end if
if MSSignedDate <> "" then
sSQL = sSQL & "'" & MSSignedDate & "', "
else
sSQL = sSQL & "NULL, "
end if
if CustomerSignedDate <> "" then
sSQL = sSQL & "'" & CustomerSignedDate & "', "
else
sSQL = sSQL & "NULL, "
end if
if DateSentTOMSSigner <> "" then
sSQL = sSQL & "'" & DateSentTOMSSigner & "', "
else
sSQL = sSQL & "NULL, "
end if
if DateReceivedFromMSSigner <> "" then
sSQL = sSQL & "'" & DateReceivedFromMSSigner & "', "
else
sSQL = sSQL & "NULL, "
end if
if MSSignerEmailAlias <> "" then
sSQL = sSQL & "'" & MSSignerEmailAlias & "', "
else
sSQL = sSQL & "NULL, "
end if
if DateRejectedByMSSigner <> "" then
sSQL = sSQL & "'" & DateRejectedByMSSigner & "', "
else
sSQL = sSQL & "NULL, "
end if
if SentToAccountingDate <> "" then
sSQL = sSQL & "'" & SentToAccountingDate & "', "
else
sSQL = sSQL & "NULL, "
end if
if SentToLegalDate <> "" then
sSQL = sSQL & "'" & SentToLegalDate & "', "
else
sSQL = sSQL & "NULL, "
end if
if SenttoAdminDate <> "" then
sSQL = sSQL & "'" & SenttoAdminDate & "', "
else
sSQL = sSQL & "NULL, "
end if
if ShipDate <> "" then
sSQL = sSQL & "'" & ShipDate & "', "
else
sSQL = sSQL & "NULL, "
end if
if ShippedViaID <> "" then
sSQL = sSQL & ShippedViaID & ", "
else
sSQL = sSQL & "NULL, "
end if
if ShipID <> "" then
sSQL = sSQL & ShipID
else
sSQL = sSQL & "NULL"
end if
bFlag = getRecordset(sSQL, rsUpdate)
if not bFlag then
Response.Write getLastDBError
Call RollBack
SaveRecord = False
else
SaveRecord = True
end if
End Function
'[START] LW2.8 Bug 6941 v-reenag 14/14/2003 : saving the user's preferred date format
function SaveUserDateFormat()
SaveUserDateFormat = True
if IsNull(rsDateFormat("UserD
ateFormat"
)) or sCurrentDateFormat <> rsDateFormat("UserDateForm
at") Then
'Update Users table with the date format that user chose
Const SQL_UpdateDateFormat = "Exec usp_UpdateDateFormat '@EMailAlias', '@DateFormat'"
Dim sSQLUpdate
Dim rsUpdateDateFormat
sSQLUpdate = Replace(SQL_UpdateDateForm
at, "@EMailAlias", gsEmailAlias)
sSQLUpdate = Replace(sSQLUpdate, "@DateFormat", sCurrentDateFormat)
bFlag = getRecordset(sSQLUpdate, rsUpdateDateFormat)
if not bFlag then
Response.Write getLastDBError
Call RollBack
SaveUserDateFormat = False
else
SaveUserDateFormat = True
end if
end if
end function
'[START] Bug#6590 v-yashk on 05/23/03
function GetRoutingServerName()
dim sSQL, rsServer
sSQL = "select RoutingServerName + '/' + AppPath RoutingServer from RoutingProperties"
if not getRecordset(sSQL, rsServer) then
Response.Write GetLastDBError
Response.End
end if
GetRoutingServerName = rsServer.fields(0).Value
end function
'[END] Bug#6590
%>
<Span name="PageHeader" id="PageHeader" Style="Display:inline">
<font color="blue" size="3">List of Agreements with Post Routing Infomation </font>
<p>
<table border="0">
<tr>
<td>Select date format:</td>
<!-- [Start]v-reenag.11/14/03.L
W 2.8 BugId:6836. Passing sDateFormat as 'dd/mm/yyyy' or 'mm/dd/yyyy'. -->
<td><input type="radio" name="rdoDateFormat" onclick="ChangeDateFormat(
'dd/mm/yyy
y')" <%if sCurrentDateFormat = "dd/mm/yyyy" Then %>Checked<%End If%> value="dd/mm/yyyy"><b>dd/m
m/yy</td>
<td><input type="radio" name="rdoDateFormat" onclick="ChangeDateFormat(
'mm/dd/yyy
y')" <%if sCurrentDateFormat = "mm/dd/yyyy" Or IsNull(sCurrentDateFormat)
Or sCurrentDateFormat = "" Then %>Checked<%End If%> value="mm/dd/yyyy"><b>mm/d
d/yy</td>
<!-- [End]BugId:6836 -->
<td><span name="DateFormat" id="DateFormat" Style="Display:none">
<font color="Red"> &n
bsp;Applyi
ng selected date format....</Font>
</span>
</td>
</tr>
</table>
</Span>
<script language = "JavaScript">
aryDateFieldsJS = new Array("OriginalReceivedDat
e", "MSSignedDate", "CustomerSignedDate", "DateSentTOMSSigner", "DateReceivedFromMSSigner"
,"DateReje
ctedByMSSi
gner", "SentToAccountingDate", "SentToLegalDate", "SenttoAdminDate", "ShipDate");
function isDateJS(str) {
d=new Date(str);
return !isNaN(d);
}
function ConvertDateFormatJS(sInput
) {
sTemp = sInput.split( "/");
sDate = sTemp[1] + "/" + sTemp[0] + "/" + sTemp[2];
return sDate;
}
function Initialise() {
document.all.Progress.styl
e.display=
"none";
if (document.all.rdoDateForma
t[0].check
ed)
{
document.all.CurrentDateFo
rmat.value
="dd/mm/yy
yy";
}
else if (document.all.rdoDateForma
t[1].check
ed)
{
document.all.CurrentDateFo
rmat.value
="mm/dd/yy
yy";
}
}
//function ChangeDateFormat(sDateForm
at)
//{
// if (document.all.CurrentDateF
ormat.valu
e != sDateFormat)
// {
//This function changes date format in all the textboxes
// document.all.DateFormat.st
yle.displa
y="inline"
;
// var total_rows, iAryCount;
// total_rows = document.all.item("totalro
ws").value
;
// var icnt, sInput;
// for (icnt=1;icnt<total_rows+1;
icnt++)
// {
// for (iAryCount=0; iAryCount<=aryDateFieldsJS
.length - 1; iAryCount++)
// {
// if (document.all.item("txt" + aryDateFieldsJS[iAryCount]
+ "_" + icnt) !=null)
// {
// sInput = document.all.item("txt" + aryDateFieldsJS[iAryCount]
+ "_" + icnt).value;
// if (isDateJS(sInput))
// {
// document.all.item("txt" + aryDateFieldsJS[iAryCount]
+ "_" + icnt).value = ConvertDateFormatJS(sInput
);
// }
// }
// }
// }
// document.all.DateFormat.st
yle.displa
y="none";
// }
// document.all.CurrentDateFo
rmat.value
= sDateFormat;
//}
</script>
<table name="TblAgreementHeader" Name="TblAgreementHeader" border="1" width="972px">
<tr>
<!-- [Start]v-reenag.08/01/03.L
W 2.8 BugId:6631. Setting the width of the column headers. -->
<td width='79px' class="TDDate">Document# - rev</td>
<td width='61px' class="TDDate">Originals Received On</td>
<td width='61px' class="TDDate">MS Signed Date</td>
<td width='61px' class="TDDate">Customer Signed Date</td>
<td width='61px' class="TDDate">Sent to MS Signer On</td>
<td width='61px' class="TDDate">Received from MS Signer On</td>
<td width='70px' class="TDDate">MS Signer's Email</td>
<!-- [Start]v-reenag.08/01/03.L
W 2.8 BugId:6631. Removing this column -->
<!--<td width='62px' class="TDDate">Rejected by MS Signer On</td>-->
<!-- [End]BugId:6631 -->
<td width='61px' class="TDDate">Sent to Accounting Date</td>
<td width='61px' class="TDDate">Final Dist. to Legal Date</td>
<td width='61px' class="TDDate">Final Dist. to AM or Admin Date</td>
<td width='61px' class="TDDate">Originals to Customer Ship Date</td>
<td width='225px' class="TDDate">Originals to Customer</td>
<!-- [End]BugId:6631 -->
</tr>
</Table>
<DIV ID=oDiv STYLE="width: 990px; height: 375px; overflow: auto;Display:inline">
<table name="TblAgreement" Name="TblAgreement" border="1" Width='972px'>
<%
dim iRowCnt, iColCnt
dim cellId
iRowCnt = 0
do while not rsAgreement.EOF %>
<tr name="<%="Row_" & Cstr(iRowCnt+1)%>">
<%for iColCnt = 0 to rsAgreement.Fields.count -1
cellId = rsAgreement.Fields(iColCnt
).Name & "_" & Cstr(iRowCnt + 1)
select case rsAgreement.Fields(iColCnt
).Name
'all date fields
'[Start]v-reenag.08/01/200
3.LW 2.8 BugId:6631. Removing "DateRejectedByMSSigner" from the case list.
'case "OriginalReceivedDate", "MSSignedDate", "CustomerSignedDate", "DateSentTOMSSigner", "DateReceivedFromMSSigner"
, "DateRejectedByMSSigner", "SentToAccountingDate", "SentToLegalDate", "SenttoAdminDate", "ShipDate"
case "OriginalReceivedDate", "MSSignedDate", "CustomerSignedDate", "DateSentTOMSSigner", "DateReceivedFromMSSigner"
, "SentToAccountingDate", "SentToLegalDate", "SenttoAdminDate", "ShipDate"
'[End]BugId:6631.
if NOT isNull(rsAgreement.fields(
iColCnt).v
alue) then %>
<td name="<%=cellId%>" class="TDDate">
<% Dim s
s = FormatDateTime(rsAgreement
.fields(iC
olCnt).val
ue, 2)
'[Start]v-reenag.14/14/200
3.LW 2.8 BugId:6941. Converting the format to "dd/mm/yyyy" when that is the user's preferred dated format.
if sCurrentDateFormat = "dd/mm/yyyy" Then
Dim sTemp
sTemp = Split(s, "/")
s = sTemp(1) & "/" & sTemp(0) & "/" & sTemp(2)
End If
'[End]v-reenag.14/14/2003.
LW 2.8 BugId:6941.
%>
<input onkeydown="txt_onkeydown('
txt<%=cell
Id%>')" ondblclick="calpopup('<%=c
ellId%>')"
class="TxtDate" type="text" name="txt<%=cellId%>" value="<%=s%>">
</td>
<% else %>
<td name="<%=cellId%>" class="TDDate">
<input onkeydown="txt_onkeydown('
txt<%=cell
Id%>')" ondblclick="calpopup('<%=c
ellId%>')"
class="TxtDate" type="text" name="txt<%=cellId%>" value="">
</td>
<%end if%>
<% case "AgreementNumber" %>
<td name="<%=cellId%>" width='80px' class="TDDate">
<% dim sAgreement
sAgreement = rsAgreement.fields("Agreem
entNumber"
).value & "-" & rsAgreement.fields("Agreem
entRevisio
n").value
Response.Write(sAgreement)
%>
<input type="hidden" name="hdAgreementId_<%=Cst
r(iRowCnt + 1)%>" value="<%=rsAgreement.fiel
ds("Agreem
entId").va
lue%>">
</td>
<% case "MSSignerEmailAlias"
'Non-date fields
if NOT isNull(rsAgreement.fields(
iColCnt).v
alue) and len(trim(rsAgreement.field
s(iColCnt)
.value)) <> 0 then %>
<td name="<%=cellId%>" class="TDDate">
<!-- class="TxtDate" is being used because of similarity in the properties although its not a date field-->
<input onkeydown="txt_onkeydown('
txt<%=cell
Id%>')" type="text" style="Width:67px; HEIGHT: 24px;font-family : Times New Roman; font-size : 8pt" value="<%=rsAgreement.fiel
ds(iColCnt
).value & ""%>" name="txt<%=cellId%>" size="20">
</td>
<%else%>
<td name="<%=cellId%>" class="TDDate">
<!-- class="TxtDate" is being used because of similarity in the properties although its not a date field-->
<input onkeydown="txt_onkeydown('
txt<%=cell
Id%>')" type="text" style="Width:67px; HEIGHT: 24px;font-family : Times New Roman; font-size : 8pt" value="" name="txt<%=cellId%>" size="20">
</td>
<%end if %>
<% case "ShippedViaID" %>
<!-- For ShippedViaId -->
<td name="<%=cellId%>" width='232px' class="TDDate">
<select name="sel<%=cellId%>" class="SelectStyle">
<option value="NULL"> N/A
<%
rsShippedVia.MoveFirst
Do while not rsShippedVia.eof
Response.Write "<font name=" & chr(32) & "Times New Roman" & chr(32) & " font-size=" & chr(32) & "8pt" & chr(32) & "><OPTION value='" & rsShippedVia("ShippedViaID
") & "'"
if rsShippedVia("ShippedViaID
") = rsAgreement("ShippedViaID"
) then
Response.Write " SELECTED"
end If
Response.Write ">" & rsShippedVia("ShippedViaNa
me") & "</font>"
rsShippedVia.MoveNext
Loop
%>
</select>
<!-- For Ship Id -->
<%if NOT isNull(rsAgreement("ShipID
")) and Len(trim(rsAgreement("Ship
ID"))) <> 0 then %>
<input onkeydown="txt_onkeydown('
txt<%=cell
Id%>')" type="text" style="Width:74px; HEIGHT: 24px;font-family : Times New Roman; font-size : 8pt" value="<%=rsAgreement("Shi
pID") & ""%>" name="txtShipID_<%=Cstr(iR
owCnt + 1)%>">
<%else%>
<input onkeydown="txt_onkeydown('
txt<%=cell
Id%>')" type="text" style="Width:74px; HEIGHT: 24px;font-family : Times New Roman; font-size : 8pt" value="" name="txtShipID_<%=Cstr(iR
owCnt + 1)%>">
<%end if %>
</td>
<% End Select %>
<%next %>
</tr>
<!--</Table> -->
<% rsAgreement.MoveNext
iRowCnt = iRowCnt + 1
loop %>
</font></table></Div>
</FONT>
<br><br>
<input type="button" id="btnSubmit" name="btnSubmit" value="Update" onClick="ValidateMe()">
<!-- Bug#6590 v-yashk on 05/23/03 -->
<input type="button" id="btnBack" name="btnBack" value="Back" onClick="window.location.h
ref='<%=Ge
tRoutingSe
rverName%>
'">
<!-- Bug#6590 -->
<input type="hidden" name="totalrows" value="<%=Cstr(iRowCnt)%>"
>
<!-- [START] LW2.8 Bug 6836 v-reenag 11/14/2003 : adding the hidden field, CurrentDateFormat and removing dateformatchanged-->
<input type="hidden" name="CurrentDateFormat"><
BR>
<!--<input type="hidden" name="dateformatchanged" value="1">-->
<!-- [END] LW2.8 Bug 6836 v-reenag 11/14/2003-->
<input type="hidden" name="companycode" value="<%=sCompanyCode%>">
<%
if Request.Form("flag") = "" then
Response.Write("<input type=" & chr(34) & "hidden" & chr(34) & " name=" & chr(34) & "flag" & chr(34) & " value=" & chr(34) & "0" & chr(34) & ">")
else
Response.Write("<input type=" & chr(34) & "hidden" & chr(34) & " name=" & chr(34) & "flag" & chr(34) & " value=" & chr(34) & (cint(Request.Form("flag")
) + 1) & chr(34) & ">")
end if
'Response.Flush
%>
<!-- [START] Bug#6357 v-yashk 05/27/2003 Inline display of calender control using Div-->
<Div id="PopCal" Name="PopCal" class="PopCal">
<BODY class=Calendar">
<TABLE class="Calender" id=CalendarTable name=CalendarTable>
<TR>
<TH class=CalendarBack Language=JavaScript onClick="BackMonth()"><
</TD>
<TH id=CalHeader colspan=5 align=center class=CalendarHeader> 
;</TD>
<TH class=CalendarForward Language=JavaScript onClick="ForwardMonth()">&
gt;</TD>
</TR>
<TR>
<TD width=14% class=CalendarDayHeader>Su
n</TD>
<TD width=14% class=CalendarDayHeader>Mo
n</TD>
<TD width=14% class=CalendarDayHeader>Tu
e</TD>
<TD width=14% class=CalendarDayHeader>We
d</TD>
<TD width=14% class=CalendarDayHeader>Th
u</TD>
<TD width=14% class=CalendarDayHeader>Fr
i</TD>
<TD width=14% class=CalendarDayHeader>Sa
t</TD>
</TR>
<TR>
<TD id=Cell_1 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
1')" style="CURSOR: default;"> </TD>
<TD id=Cell_2 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
2')" style="CURSOR: default;"> </TD>
<TD id=Cell_3 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
3')" style="CURSOR: default;"> </TD>
<TD id=Cell_4 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
4')" style="CURSOR: default;"> </TD>
<TD id=Cell_5 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
5')" style="CURSOR: default;"> </TD>
<TD id=Cell_6 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
6')" style="CURSOR: default;"> </TD>
<TD id=Cell_7 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
7')" style="CURSOR: default;"> </TD>
</TR>
<TR>
<TD id=Cell_8 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
8')" style="CURSOR: default;"> </TD>
<TD id=Cell_9 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
9')" style="CURSOR: default;"> </TD>
<TD id=Cell_10 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
10')" style="CURSOR: default;"> </TD>
<TD id=Cell_11 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
11')" style="CURSOR: default;"> </TD>
<TD id=Cell_12 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
12')" style="CURSOR: default;"> </TD>
<TD id=Cell_13 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
13')" style="CURSOR: default;"> </TD>
<TD id=Cell_14 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
14')" style="CURSOR: default;"> </TD>
</TR>
<TR>
<TD id=Cell_15 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
15')" style="CURSOR: default;"> </TD>
<TD id=Cell_16 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
16')" style="CURSOR: default;"> </TD>
<TD id=Cell_17 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
17')" style="CURSOR: default;"> </TD>
<TD id=Cell_18 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
18')" style="CURSOR: default;"> </TD>
<TD id=Cell_19 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
19')" style="CURSOR: default;"> </TD>
<TD id=Cell_20 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
20')" style="CURSOR: default;"> </TD>
<TD id=Cell_21 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
21')" style="CURSOR: default;"> </TD>
</TR>
<TR>
<TD id=Cell_22 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
22')" style="CURSOR: default;"> </TD>
<TD id=Cell_23 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
23')" style="CURSOR: default;"> </TD>
<TD id=Cell_24 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
24')" style="CURSOR: default;"> </TD>
<TD id=Cell_25 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
25')" style="CURSOR: default;"> </TD>
<TD id=Cell_26 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
26')" style="CURSOR: default;"> </TD>
<TD id=Cell_27 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
27')" style="CURSOR: default;"> </TD>
<TD id=Cell_28 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
28')" style="CURSOR: default;"> </TD>
</TR>
<TR>
<TD id=Cell_29 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
29')" style="CURSOR: default;"> </TD>
<TD id=Cell_30 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
30')" style="CURSOR: default;"> </TD>
<TD id=Cell_31 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
31')" style="CURSOR: default;"> </TD>
<TD id=Cell_32 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
32')" style="CURSOR: default;"> </TD>
<TD id=Cell_33 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
33')" style="CURSOR: default;"> </TD>
<TD id=Cell_34 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
34')" style="CURSOR: default;"> </TD>
<TD id=Cell_35 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
35')" style="CURSOR: default;"> </TD>
</TR>
<TR>
<TD id=Cell_36 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
36')" style="CURSOR: default;"> </TD>
<TD id=Cell_37 class=CalendarDate Language=JavaScript onClick="ChooseDate('Cell_
37')" style="CURSOR: default;"> </TD>
<!-- The last five cells can't contain a valid date, no days past 31 -->
<TD class=CalendarDate style="CURSOR: default;"> </TD>
<TD class=CalendarDate style="CURSOR: default;"> </TD>
<TD class=CalendarDate style="CURSOR: default;"> </TD>
<TD class=CalendarDate style="CURSOR: default;"> </TD>
<TD class=CalendarDate><img src="/../images/Close.gif"
onclick="document.all.PopC
al.style.d
isplay='no
ne'"></TD>
</TR>
</TABLE> </Body> </Div>
<!-- [END] Bug#6357-->
</form>
</body>
</html>