<%@ CodePage=65001 %> <% Const EW_PAGE_ID = "add" Const EW_TABLE_NAME = "Coaches" %> <% Session.Timeout = 100 %> <% Response.Expires = 0 Response.ExpiresAbsolute = Now() - 1 Response.AddHeader "pragma", "no-cache" Response.AddHeader "cache-control", "private, no-cache, no-store, must-revalidate" %> <% ' Open connection to the database Dim conn Set conn = Server.CreateObject("ADODB.Connection") conn.Open EW_DB_CONNECTION_STRING %> <% Dim Security Set Security = New cAdvancedSecurity %> <% If Not Security.IsLoggedIn() Then Call Security.AutoLogin() If Not Security.IsLoggedIn() Then Call Security.SaveLastUrl() Call Page_Terminate("login.asp") End If %> <% ' Common page loading event (in userfn60.asp) Call Page_Loading() %> <% ' Page load event, used in current page Call Page_Load() %> <% Response.Buffer = True ' Load key values from QueryString Dim bCopy bCopy = True If Request.QueryString("ID").Count > 0 Then Coaches.ID.QueryStringValue = Request.QueryString("ID") Else bCopy = False End If ' Create form object Dim objForm Set objForm = ew_GetUploadObj() ' Process form if post back If objForm.GetValue("a_add")&"" <> "" Then Coaches.CurrentAction = objForm.GetValue("a_add") ' Get form action Call GetUploadFiles() ' Get upload files Call LoadFormValues() ' Load form values ' Not post back Else If bCopy Then Coaches.CurrentAction = "C" ' Copy Record Else Coaches.CurrentAction = "I" ' Display Blank Record Call LoadDefaultValues() ' Load default values End If End If ' Close form object Set objForm = Nothing ' Perform action based on action code Select Case Coaches.CurrentAction Case "I" ' Blank record, no action required Case "C" ' Copy an existing record If Not LoadRow() Then ' Load record based on key Session(EW_SESSION_MESSAGE) = "No records found" ' No record found Call Page_Terminate(Coaches.ReturnUrl) ' Clean up and return End If Case "A" ' Add new record Coaches.SendEmail = True ' Send email on add success If AddRow() Then ' Add successful Session(EW_SESSION_MESSAGE) = "Add New Record Successful" ' Set up success message Call Page_Terminate(Coaches.KeyUrl(Coaches.ReturnUrl, "")) ' Clean up and return Else Call RestoreFormValues() ' Add failed, restore form values End If End Select ' Render row based on row type Coaches.RowType = EW_ROWTYPE_ADD ' add ' Render add type Call RenderRow() %>

Add to TABLE: Coaches

Go Back

<% If Session(EW_SESSION_MESSAGE) <> "" Then ' Mesasge in Session, display %>

<%= Session(EW_SESSION_MESSAGE) %>

<% Session(EW_SESSION_MESSAGE) = "" ' Clear message in Session End If %>

> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Full Name *
Photo
Club
Telephone
e Mail
Address
City
Country
Height
Weight
CV English
CV Portuguese
CV Arabic
CV Russian
CV Korean
Video File Name
Mobile

<% ' If control is passed here, simply terminate the page without redirect Call Page_Terminate("") ' ----------------------------------------------------------------- ' Subroutine Page_Terminate ' - called when exit page ' - clean up ADO connection and objects ' - if url specified, redirect to url, otherwise end response ' Sub Page_Terminate(url) ' Page unload event, used in current page Call Page_Unload() ' Global page unloaded event (in userfn60.asp) Call Page_Unloaded() conn.Close ' Close Connection Set conn = Nothing Set Security = Nothing Set Coaches = Nothing ' Go to url if specified If url <> "" Then Response.Clear Response.Redirect url End If ' Terminate response Response.End End Sub ' ' Subroutine Page_Terminate (End) ' ---------------------------------------- %> <% ' Function Get upload files Function GetUploadFiles() ' Get upload data If Coaches.Picture.Upload.UploadFile() Then ' No action required Else Response.Write Coaches.Picture.Upload.Message Response.End End If If Coaches.CV_English.Upload.UploadFile() Then ' No action required Else Response.Write Coaches.CV_English.Upload.Message Response.End End If If Coaches.CV_Portuguese.Upload.UploadFile() Then ' No action required Else Response.Write Coaches.CV_Portuguese.Upload.Message Response.End End If If Coaches.CV_Arabic.Upload.UploadFile() Then ' No action required Else Response.Write Coaches.CV_Arabic.Upload.Message Response.End End If If Coaches.CV_Russian.Upload.UploadFile() Then ' No action required Else Response.Write Coaches.CV_Russian.Upload.Message Response.End End If If Coaches.CV_Korean.Upload.UploadFile() Then ' No action required Else Response.Write Coaches.CV_Korean.Upload.Message Response.End End If End Function %> <% ' Load default values Function LoadDefaultValues() End Function %> <% ' Load form values Function LoadFormValues() ' Load from form Coaches.FullName.FormValue = objForm.GetValue("x_FullName") Coaches.Club.FormValue = objForm.GetValue("x_Club") Coaches.Telephone.FormValue = objForm.GetValue("x_Telephone") Coaches.eMail.FormValue = objForm.GetValue("x_eMail") Coaches.Address.FormValue = objForm.GetValue("x_Address") Coaches.City.FormValue = objForm.GetValue("x_City") Coaches.Country.FormValue = objForm.GetValue("x_Country") Coaches.Height.FormValue = objForm.GetValue("x_Height") Coaches.Weight.FormValue = objForm.GetValue("x_Weight") Coaches.VideoFileName.FormValue = objForm.GetValue("x_VideoFileName") Coaches.Mobile.FormValue = objForm.GetValue("x_Mobile") End Function ' Restore form values Function RestoreFormValues() Coaches.FullName.CurrentValue = Coaches.FullName.FormValue Coaches.Club.CurrentValue = Coaches.Club.FormValue Coaches.Telephone.CurrentValue = Coaches.Telephone.FormValue Coaches.eMail.CurrentValue = Coaches.eMail.FormValue Coaches.Address.CurrentValue = Coaches.Address.FormValue Coaches.City.CurrentValue = Coaches.City.FormValue Coaches.Country.CurrentValue = Coaches.Country.FormValue Coaches.Height.CurrentValue = Coaches.Height.FormValue Coaches.Weight.CurrentValue = Coaches.Weight.FormValue Coaches.VideoFileName.CurrentValue = Coaches.VideoFileName.FormValue Coaches.Mobile.CurrentValue = Coaches.Mobile.FormValue End Function %> <% ' Load row based on key values Function LoadRow() Dim rs, sSql, sFilter sFilter = Coaches.SqlKeyFilter If Not IsNumeric(Coaches.ID.CurrentValue) Then LoadRow = False ' Invalid key, exit Exit Function End If sFilter = Replace(sFilter, "@ID@", ew_AdjustSql(Coaches.ID.CurrentValue)) ' Replace key value ' Call Row Selecting event Call Coaches.Row_Selecting(sFilter) ' Load sql based on filter Coaches.CurrentFilter = sFilter sSql = Coaches.SQL Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sSql, conn If rs.Eof Then LoadRow = False Else LoadRow = True rs.MoveFirst Call LoadRowValues(rs) ' Load row values ' Call Row Selected event Call Coaches.Row_Selected(rs) End If rs.Close Set rs = Nothing End Function ' Load row values from recordset Sub LoadRowValues(rs) Coaches.ID.DbValue = rs("ID") Coaches.FullName.DbValue = rs("FullName") Coaches.Picture.Upload.DbValue = rs("Picture") Coaches.Club.DbValue = rs("Club") Coaches.Telephone.DbValue = rs("Telephone") Coaches.eMail.DbValue = rs("eMail") Coaches.Address.DbValue = rs("Address") Coaches.City.DbValue = rs("City") Coaches.Country.DbValue = rs("Country") Coaches.Height.DbValue = rs("Height") Coaches.Weight.DbValue = rs("Weight") Coaches.CV_English.Upload.DbValue = rs("CV_English") Coaches.CV_Portuguese.Upload.DbValue = rs("CV_Portuguese") Coaches.CV_Arabic.Upload.DbValue = rs("CV_Arabic") Coaches.CV_Russian.Upload.DbValue = rs("CV_Russian") Coaches.CV_Korean.Upload.DbValue = rs("CV_Korean") Coaches.VideoFileName.DbValue = rs("VideoFileName") Coaches.Mobile.DbValue = rs("Mobile") End Sub %> <% ' Render row values based on field settings Sub RenderRow() ' Call Row Rendering event Call Coaches.Row_Rendering() ' Common render codes for all row types ' FullName Coaches.FullName.CellCssStyle = "" Coaches.FullName.CellCssClass = "" ' Picture Coaches.Picture.CellCssStyle = "" Coaches.Picture.CellCssClass = "" ' Club Coaches.Club.CellCssStyle = "" Coaches.Club.CellCssClass = "" ' Telephone Coaches.Telephone.CellCssStyle = "" Coaches.Telephone.CellCssClass = "" ' eMail Coaches.eMail.CellCssStyle = "" Coaches.eMail.CellCssClass = "" ' Address Coaches.Address.CellCssStyle = "" Coaches.Address.CellCssClass = "" ' City Coaches.City.CellCssStyle = "" Coaches.City.CellCssClass = "" ' Country Coaches.Country.CellCssStyle = "" Coaches.Country.CellCssClass = "" ' Height Coaches.Height.CellCssStyle = "" Coaches.Height.CellCssClass = "" ' Weight Coaches.Weight.CellCssStyle = "" Coaches.Weight.CellCssClass = "" ' CV_English Coaches.CV_English.CellCssStyle = "" Coaches.CV_English.CellCssClass = "" ' CV_Portuguese Coaches.CV_Portuguese.CellCssStyle = "" Coaches.CV_Portuguese.CellCssClass = "" ' CV_Arabic Coaches.CV_Arabic.CellCssStyle = "" Coaches.CV_Arabic.CellCssClass = "" ' CV_Russian Coaches.CV_Russian.CellCssStyle = "" Coaches.CV_Russian.CellCssClass = "" ' CV_Korean Coaches.CV_Korean.CellCssStyle = "" Coaches.CV_Korean.CellCssClass = "" ' VideoFileName Coaches.VideoFileName.CellCssStyle = "" Coaches.VideoFileName.CellCssClass = "" ' Mobile Coaches.Mobile.CellCssStyle = "" Coaches.Mobile.CellCssClass = "" If Coaches.RowType = EW_ROWTYPE_VIEW Then ' View row ElseIf Coaches.RowType = EW_ROWTYPE_ADD Then ' Add row ' FullName Coaches.FullName.EditCustomAttributes = "" Coaches.FullName.EditValue = ew_HtmlEncode(Coaches.FullName.CurrentValue) ' Picture Coaches.Picture.EditCustomAttributes = "" If Not IsNull(Coaches.Picture.Upload.DbValue) Then Coaches.Picture.EditValue = Coaches.Picture.Upload.DbValue Coaches.Picture.ImageAlt = "" Else Coaches.Picture.EditValue = "" End If ' Club Coaches.Club.EditCustomAttributes = "" sSqlWrk = "SELECT [ID], [Name], [Contact_Person] FROM [Clubs]" sSqlWrk = sSqlWrk & " ORDER BY [Name] Asc" Set rswrk = Server.CreateObject("ADODB.Recordset") rswrk.Open sSqlWrk, conn If Not rswrk.Eof Then arwrk = rswrk.GetRows Else arwrk = "" End If rswrk.Close Set rswrk = Nothing arwrk = ew_AddItemToArray(arwrk, 0, Array("", "Please Select", "")) Coaches.Club.EditValue = arwrk ' Telephone Coaches.Telephone.EditCustomAttributes = "" Coaches.Telephone.EditValue = ew_HtmlEncode(Coaches.Telephone.CurrentValue) ' eMail Coaches.eMail.EditCustomAttributes = "" Coaches.eMail.EditValue = ew_HtmlEncode(Coaches.eMail.CurrentValue) ' Address Coaches.Address.EditCustomAttributes = "" Coaches.Address.EditValue = Coaches.Address.CurrentValue ' City Coaches.City.EditCustomAttributes = "" Coaches.City.EditValue = ew_HtmlEncode(Coaches.City.CurrentValue) ' Country Coaches.Country.EditCustomAttributes = "" sSqlWrk = "SELECT [ID], [countryname] FROM [Countrylist]" sSqlWrk = sSqlWrk & " ORDER BY [countryname] Asc" Set rswrk = Server.CreateObject("ADODB.Recordset") rswrk.Open sSqlWrk, conn If Not rswrk.Eof Then arwrk = rswrk.GetRows Else arwrk = "" End If rswrk.Close Set rswrk = Nothing arwrk = ew_AddItemToArray(arwrk, 0, Array("", "Please Select")) Coaches.Country.EditValue = arwrk ' Height Coaches.Height.EditCustomAttributes = "" Coaches.Height.EditValue = ew_HtmlEncode(Coaches.Height.CurrentValue) ' Weight Coaches.Weight.EditCustomAttributes = "" Coaches.Weight.EditValue = ew_HtmlEncode(Coaches.Weight.CurrentValue) ' CV_English Coaches.CV_English.EditCustomAttributes = "" If Not IsNull(Coaches.CV_English.Upload.DbValue) Then Coaches.CV_English.EditValue = Coaches.CV_English.Upload.DbValue Else Coaches.CV_English.EditValue = "" End If ' CV_Portuguese Coaches.CV_Portuguese.EditCustomAttributes = "" If Not IsNull(Coaches.CV_Portuguese.Upload.DbValue) Then Coaches.CV_Portuguese.EditValue = Coaches.CV_Portuguese.Upload.DbValue Else Coaches.CV_Portuguese.EditValue = "" End If ' CV_Arabic Coaches.CV_Arabic.EditCustomAttributes = "" If Not IsNull(Coaches.CV_Arabic.Upload.DbValue) Then Coaches.CV_Arabic.EditValue = Coaches.CV_Arabic.Upload.DbValue Else Coaches.CV_Arabic.EditValue = "" End If ' CV_Russian Coaches.CV_Russian.EditCustomAttributes = "" If Not IsNull(Coaches.CV_Russian.Upload.DbValue) Then Coaches.CV_Russian.EditValue = Coaches.CV_Russian.Upload.DbValue Else Coaches.CV_Russian.EditValue = "" End If ' CV_Korean Coaches.CV_Korean.EditCustomAttributes = "" If Not IsNull(Coaches.CV_Korean.Upload.DbValue) Then Coaches.CV_Korean.EditValue = Coaches.CV_Korean.Upload.DbValue Else Coaches.CV_Korean.EditValue = "" End If ' VideoFileName Coaches.VideoFileName.EditCustomAttributes = "" Coaches.VideoFileName.EditValue = ew_HtmlEncode(Coaches.VideoFileName.CurrentValue) ' Mobile Coaches.Mobile.EditCustomAttributes = "" Coaches.Mobile.EditValue = ew_HtmlEncode(Coaches.Mobile.CurrentValue) ElseIf Coaches.RowType = EW_ROWTYPE_EDIT Then ' Edit row ElseIf Coaches.RowType = EW_ROWTYPE_SEARCH Then ' Search row End If ' Call Row Rendered event Call Coaches.Row_Rendered() End Sub %> <% ' Add record Function AddRow() On Error Resume Next Dim rs, sSql, sFilter Dim rsnew Dim bCheckKey, sSqlChk, sWhereChk, rsChk Dim bInsertRow ' Check for duplicate key bCheckKey = True sFilter = Coaches.SqlKeyFilter If Coaches.ID.CurrentValue = "" Or IsNull(Coaches.ID.CurrentValue) Then bCheckKey = False Else sFilter = Replace(sFilter, "@ID@", ew_AdjustSql(Coaches.ID.CurrentValue)) ' Replace key value End If If Not IsNumeric(Coaches.ID.CurrentValue) Then bCheckKey = False End If If bCheckKey Then Set rsChk = Coaches.LoadRs(sFilter) If Not (rsChk Is Nothing) Then Session(EW_SESSION_MESSAGE) = "Duplicate value for primary key" rsChk.Close Set rsChk = Nothing AddRow = False Exit Function End If End If ' Add new record sFilter = "(0 = 1)" Coaches.CurrentFilter = sFilter sSql = Coaches.SQL Set rs = Server.CreateObject("ADODB.Recordset") rs.CursorLocation = EW_CURSORLOCATION rs.Open sSql, conn, 1, 2 rs.AddNew If Err.Number <> 0 Then Session(EW_SESSION_MESSAGE) = Err.Description rs.Close Set rs = Nothing AddRow = False Exit Function End If ' Field FullName Call Coaches.FullName.SetDbValue(Coaches.FullName.CurrentValue, Null) rs("FullName") = Coaches.FullName.DbValue ' Field Picture Call Coaches.Picture.Upload.SaveToSession() ' Save file value to Session Coaches.Picture.Upload.DbValue = rs("Picture") ' Get original value If IsNull(Coaches.Picture.Upload.Value) Then rs("Picture") = Null Else rs("Picture") = ew_UploadFileNameEx(ew_UploadPathEx(True, "pictures/"), Coaches.Picture.Upload.FileName) End If ' Field Club Call Coaches.Club.SetDbValue(Coaches.Club.CurrentValue, Null) rs("Club") = Coaches.Club.DbValue ' Field Telephone Call Coaches.Telephone.SetDbValue(Coaches.Telephone.CurrentValue, Null) rs("Telephone") = Coaches.Telephone.DbValue ' Field eMail Call Coaches.eMail.SetDbValue(Coaches.eMail.CurrentValue, Null) rs("eMail") = Coaches.eMail.DbValue ' Field Address Call Coaches.Address.SetDbValue(Coaches.Address.CurrentValue, Null) rs("Address") = Coaches.Address.DbValue ' Field City Call Coaches.City.SetDbValue(Coaches.City.CurrentValue, Null) rs("City") = Coaches.City.DbValue ' Field Country Call Coaches.Country.SetDbValue(Coaches.Country.CurrentValue, Null) rs("Country") = Coaches.Country.DbValue ' Field Height Call Coaches.Height.SetDbValue(Coaches.Height.CurrentValue, Null) rs("Height") = Coaches.Height.DbValue ' Field Weight Call Coaches.Weight.SetDbValue(Coaches.Weight.CurrentValue, Null) rs("Weight") = Coaches.Weight.DbValue ' Field CV_English Call Coaches.CV_English.Upload.SaveToSession() ' Save file value to Session Coaches.CV_English.Upload.DbValue = rs("CV_English") ' Get original value If IsNull(Coaches.CV_English.Upload.Value) Then rs("CV_English") = Null Else rs("CV_English") = ew_UploadFileNameEx(ew_UploadPathEx(True, "cvs/"), Coaches.CV_English.Upload.FileName) End If ' Field CV_Portuguese Call Coaches.CV_Portuguese.Upload.SaveToSession() ' Save file value to Session Coaches.CV_Portuguese.Upload.DbValue = rs("CV_Portuguese") ' Get original value If IsNull(Coaches.CV_Portuguese.Upload.Value) Then rs("CV_Portuguese") = Null Else rs("CV_Portuguese") = ew_UploadFileNameEx(ew_UploadPathEx(True, "cvs/"), Coaches.CV_Portuguese.Upload.FileName) End If ' Field CV_Arabic Call Coaches.CV_Arabic.Upload.SaveToSession() ' Save file value to Session Coaches.CV_Arabic.Upload.DbValue = rs("CV_Arabic") ' Get original value If IsNull(Coaches.CV_Arabic.Upload.Value) Then rs("CV_Arabic") = Null Else rs("CV_Arabic") = ew_UploadFileNameEx(ew_UploadPathEx(True, "cvs/"), Coaches.CV_Arabic.Upload.FileName) End If ' Field CV_Russian Call Coaches.CV_Russian.Upload.SaveToSession() ' Save file value to Session Coaches.CV_Russian.Upload.DbValue = rs("CV_Russian") ' Get original value If IsNull(Coaches.CV_Russian.Upload.Value) Then rs("CV_Russian") = Null Else rs("CV_Russian") = ew_UploadFileNameEx(ew_UploadPathEx(True, "cvs/"), Coaches.CV_Russian.Upload.FileName) End If ' Field CV_Korean Call Coaches.CV_Korean.Upload.SaveToSession() ' Save file value to Session Coaches.CV_Korean.Upload.DbValue = rs("CV_Korean") ' Get original value If IsNull(Coaches.CV_Korean.Upload.Value) Then rs("CV_Korean") = Null Else rs("CV_Korean") = ew_UploadFileNameEx(ew_UploadPathEx(True, "cvs/"), Coaches.CV_Korean.Upload.FileName) End If ' Field VideoFileName Call Coaches.VideoFileName.SetDbValue(Coaches.VideoFileName.CurrentValue, Null) rs("VideoFileName") = Coaches.VideoFileName.DbValue ' Field Mobile Call Coaches.Mobile.SetDbValue(Coaches.Mobile.CurrentValue, Null) rs("Mobile") = Coaches.Mobile.DbValue ' Check recordset update error If Err.Number <> 0 Then Session(EW_SESSION_MESSAGE) = Err.Description rs.Close Set rs = Nothing AddRow = False Exit Function End If ' Call Row Inserting event bInsertRow = Coaches.Row_Inserting(rs) If bInsertRow Then ' Field Picture If Not IsNull(Coaches.Picture.Upload.Value) Then Call ew_SaveFile(ew_UploadPathEx(True, "pictures/"), rs("Picture"), Coaches.Picture.Upload.Value) If Coaches.Picture.Upload.Action = "2" Or Coaches.Picture.Upload.Action = "3" Then ' Update/Remove If Coaches.Picture.Upload.DbValue <> "" Then ew_DeleteFile ew_UploadPathEx(True, "pictures/") & Coaches.Picture.Upload.DbValue End If ' Field CV_English If Not IsNull(Coaches.CV_English.Upload.Value) Then Call ew_SaveFile(ew_UploadPathEx(True, "cvs/"), rs("CV_English"), Coaches.CV_English.Upload.Value) If Coaches.CV_English.Upload.Action = "2" Or Coaches.CV_English.Upload.Action = "3" Then ' Update/Remove If Coaches.CV_English.Upload.DbValue <> "" Then ew_DeleteFile ew_UploadPathEx(True, "cvs/") & Coaches.CV_English.Upload.DbValue End If ' Field CV_Portuguese If Not IsNull(Coaches.CV_Portuguese.Upload.Value) Then Call ew_SaveFile(ew_UploadPathEx(True, "cvs/"), rs("CV_Portuguese"), Coaches.CV_Portuguese.Upload.Value) If Coaches.CV_Portuguese.Upload.Action = "2" Or Coaches.CV_Portuguese.Upload.Action = "3" Then ' Update/Remove If Coaches.CV_Portuguese.Upload.DbValue <> "" Then ew_DeleteFile ew_UploadPathEx(True, "cvs/") & Coaches.CV_Portuguese.Upload.DbValue End If ' Field CV_Arabic If Not IsNull(Coaches.CV_Arabic.Upload.Value) Then Call ew_SaveFile(ew_UploadPathEx(True, "cvs/"), rs("CV_Arabic"), Coaches.CV_Arabic.Upload.Value) If Coaches.CV_Arabic.Upload.Action = "2" Or Coaches.CV_Arabic.Upload.Action = "3" Then ' Update/Remove If Coaches.CV_Arabic.Upload.DbValue <> "" Then ew_DeleteFile ew_UploadPathEx(True, "cvs/") & Coaches.CV_Arabic.Upload.DbValue End If ' Field CV_Russian If Not IsNull(Coaches.CV_Russian.Upload.Value) Then Call ew_SaveFile(ew_UploadPathEx(True, "cvs/"), rs("CV_Russian"), Coaches.CV_Russian.Upload.Value) If Coaches.CV_Russian.Upload.Action = "2" Or Coaches.CV_Russian.Upload.Action = "3" Then ' Update/Remove If Coaches.CV_Russian.Upload.DbValue <> "" Then ew_DeleteFile ew_UploadPathEx(True, "cvs/") & Coaches.CV_Russian.Upload.DbValue End If ' Field CV_Korean If Not IsNull(Coaches.CV_Korean.Upload.Value) Then Call ew_SaveFile(ew_UploadPathEx(True, "cvs/"), rs("CV_Korean"), Coaches.CV_Korean.Upload.Value) If Coaches.CV_Korean.Upload.Action = "2" Or Coaches.CV_Korean.Upload.Action = "3" Then ' Update/Remove If Coaches.CV_Korean.Upload.DbValue <> "" Then ew_DeleteFile ew_UploadPathEx(True, "cvs/") & Coaches.CV_Korean.Upload.DbValue End If ' Clone new rs object Set rsnew = ew_CloneRs(rs) rs.Update If Err.Number <> 0 Then Session(EW_SESSION_MESSAGE) = Err.Description AddRow = False Else AddRow = True End If Else rs.CancelUpdate If Coaches.CancelMessage <> "" Then Session(EW_SESSION_MESSAGE) = Coaches.CancelMessage Coaches.CancelMessage = "" Else Session(EW_SESSION_MESSAGE) = "Insert cancelled" End If AddRow = False End If rs.Close Set rs = Nothing If AddRow Then Coaches.ID.DbValue = rsnew("ID") ' Call Row Inserted event Call Coaches.Row_Inserted(rsnew) End If ' Field Picture Call Coaches.Picture.Upload.RemoveFromSession() ' Remove file value from Session ' Field CV_English Call Coaches.CV_English.Upload.RemoveFromSession() ' Remove file value from Session ' Field CV_Portuguese Call Coaches.CV_Portuguese.Upload.RemoveFromSession() ' Remove file value from Session ' Field CV_Arabic Call Coaches.CV_Arabic.Upload.RemoveFromSession() ' Remove file value from Session ' Field CV_Russian Call Coaches.CV_Russian.Upload.RemoveFromSession() ' Remove file value from Session ' Field CV_Korean Call Coaches.CV_Korean.Upload.RemoveFromSession() ' Remove file value from Session If IsObject(rsnew) Then rsnew.Close Set rsnew = Nothing End If End Function %> <% ' Page Load event Sub Page_Load() '***Response.Write "Page Load" Server.ScriptTimeout=1000 Session.Timeout = 1000 End Sub ' Page Unload event Sub Page_Unload() '***Response.Write "Page Unload" End Sub %>