%
if request.form <>"" then
finalStartDate = request.form("startYear")&"-"&LeadingZero(request.form("startMonth"))&"-"&LeadingZero(request.form("startDay"))&" "&LeadingZero(request.form("starHour"))&":00:00"
finalEndDate = request.form("endYear")&"-"&LeadingZero(request.form("endMonth"))&"-"&LeadingZero(request.form("endDay"))&" "&LeadingZero(request.form("endHour"))&":00:00"
if Trim(request("subject"))<>"" and Trim(request("body"))<>"" and isDate(finalStartDate) and isDate(finalEndDate) then
Dim finalTitle, finalBody, finalStartDate, finalEndDate
finalTitle = SQLin(request.form("subject"))
finalBody = SQLin(request.form("body"))
' response.write(finalTitle&"
")
' response.write(finalBody&"
")
' response.write(finalStartDate&"
")
' response.write(finalEndDate&"
")
' response.end
Dim objCom
Dim modeId:modeId = 1
Dim newsId:newsId = request.form("id")
if request.form("mode")="add" then
modeId = 0
newsId = 0
end if
Set objCom = server.createobject("adodb.command")
with objCom
.activeconnection = datastore
'.commandTimeout = 200
.commandText = dbOwnerPrefix&"spInsertUpdateAnouncement"
.commandType = adCmdStoredProc
.Parameters.Append .Createparameter("@RETURN_VALUE", adInteger, adParamReturnValue, 0 )
.Parameters.Append .Createparameter("@finalTitle", adVarChar, adParamInput, 100, finalTitle)
.Parameters.Append .Createparameter("@finalBody", adVarChar, adParamInput, 2147483647, finalBody)
.Parameters.Append .Createparameter("@finalStartDate", adDBTimeStamp, adParamInput, 0, finalStartDate)
.Parameters.Append .Createparameter("@finalEndDate", adDBTimeStamp, adParamInput, 0, finalEndDate)
.Parameters.Append .Createparameter("@id", adSmallInt, adParamInput, 0, newsId)
.Parameters.Append .Createparameter("@type", adInteger, adParamInput, 0, modeId)
.execute , , adExecuteNoRecords
end with
Set objCom = nothing
else
response.redirect ("admin_news.asp?done=no")
end if
response.clear
response.redirect ("admin_news.asp?done=yes")
end if
%>