Modificare il file:
\Buoni-spesa-OLD\EventsCode.xml
<?xml version="1.0"?> <!-- list of possible events EVENT_LOGIN_ONLOAD EVENT_BEFORELOGIN EVENT_AFTERSUCCESSFULLOGIN EVENT_AFTERUNSUCCESSFULLOGIN EVENT_REGISTER_ONLOAD EVENT_BEFOREREGISTER EVENT_AFTERSUCCESSFULREGISTRATION EVENT_AFTERUNSUCCESSFULREGISTRATION EVENT_CHANGEPASSWORD_ONLOAD EVENT_BEFORECHANGEPASSWORD EVENT_AFTERCHANGEPASSWORD EVENT_REMINDPASSWORD_ONLOAD EVENT_BEFOREREMINDPASSWORD EVENT_AFTERREMINDPASSWORD EVENT_ADD_ONLOAD EVENT_BEFOREADD EVENT_AFTERADD EVENT_LIST_ONLOAD EVENT_BEFOREDELETE EVENT_AFTERDELETE EVENT_AFTERMASSDELETE EVENT_EDIT_ONLOAD EVENT_BEFOREEDIT EVENT_AFTEREDIT EVENT_COPY_ONLOAD EVENT_BEFORECOPY EVENT_AFTERCOPY EVENT_VIEW_ONLOAD EVENT_PRINT_ONLOAD EVENT_EXPORT_ONLOAD EVENT_REPORT_ONLOAD EVENT_CHART_ONLOAD <Events> <Event>EVENT_LOGIN_ONLOAD</Event> <Event>EVENT_BEFORELOGIN</Event> <Event>EVENT_AFTERSUCCESSFULLOGIN</Event> <Event>EVENT_AFTERUNSUCCESSFULLOGIN</Event> <Event>EVENT_REGISTER_ONLOAD</Event> <Event>EVENT_BEFOREREGISTER</Event> <Event>EVENT_AFTERSUCCESSFULREGISTRATION</Event> <Event>EVENT_AFTERUNSUCCESSFULREGISTRATION</Event> <Event>EVENT_CHANGEPASSWORD_ONLOAD</Event> <Event>EVENT_BEFORECHANGEPASSWORD</Event> <Event>EVENT_AFTERCHANGEPASSWORD</Event> <Event>EVENT_REMINDPASSWORD_ONLOAD</Event> <Event>EVENT_BEFOREREMINDPASSWORD</Event> <Event>EVENT_AFTERREMINDPASSWORD</Event> <Event>EVENT_ADD_ONLOAD</Event> <Event>EVENT_BEFOREADD</Event> <Event>EVENT_AFTERADD</Event> <Event>EVENT_LIST_ONLOAD</Event> <Event>EVENT_BEFOREDELETE</Event> <Event>EVENT_AFTERDELETE</Event> <Event>EVENT_AFTERMASSDELETE</Event> <Event>EVENT_EDIT_ONLOAD</Event> <Event>EVENT_BEFOREEDIT</Event> <Event>EVENT_AFTEREDIT</Event> <Event>EVENT_COPY_ONLOAD</Event> <Event>EVENT_BEFORECOPY</Event> <Event>EVENT_AFTERCOPY</Event> <Event>EVENT_VIEW_ONLOAD</Event> <Event>EVENT_SEARCH_ONLOAD</Event> <Event>EVENT_PRINT_ONLOAD</Event> <Event>EVENT_EXPORT_ONLOAD</Event> <Event>EVENT_REPORT_ONLOAD</Event> <Event>EVENT_CHART_ONLOAD</Event> </Events> </EventCode> --> <languages> <EventCodes language="asp"> <EventCode type="EMAIL" name="Send simple email" events="all" code=" '********** Send simple email ************ ' do not forget to setup email parameters like From, SMTP server etc ' on 'Security->User login settings' dialog email="test@test.com" message="Hello there" & vbcrlf & "Best regards" subject="Sample subject" sendmail email, subject, message "> <Events/> </EventCode> <EventCode type="EMAIL" name="Send email with old data record" code=" '********** Send email with old data record ************ ' do not forget to setup email parameters like From, SMTP server etc ' on 'Security->User login settings' dialog set rsOld = CreateObject("ADODB.Recordset") email="test@test.com" message="" subject="Sample subject" ' modify the following SQL query to select fields you like to send rsOld.Open "select * from " & strTableName & " where " & where, dbConnection if not rsOld.eof then for i=0 to rsOld.Fields.Count-1 if not IsBinaryType(rsOld.Fields(i).Type) then _ message = message & rsOld.Fields(i).Name & " : " & rsOld(rsOld.Fields(i).Name) & vbcrlf next rsOld.Close end if set rsOld = Nothing sendmail email, subject, message "> <Events> <Event>EVENT_BEFOREDELETE</Event> <Event>EVENT_EDIT_ONLOAD</Event> <Event>EVENT_BEFOREEDIT</Event> <Event>EVENT_COPY_ONLOAD</Event> <Event>EVENT_BEFORECOPY</Event> <Event>EVENT_VIEW_ONLOAD</Event> </Events> </EventCode> <EventCode type="EMAIL" name="Send email with new data" code=" '********** Send email with new data ************ ' do not forget to setup email parameters like From, SMTP server etc ' on 'Security->User login settings' dialog Dim keys message ="" keys = dict.keys For n = 0 To dict.Count-1 message = message & keys(n) & " : " & dict(keys(n)) & vbcrlf Next email="test@test.com" subject="New data record" sendmail email, subject, message "> <Events> <Event>EVENT_BEFOREREGISTER</Event> <Event>EVENT_BEFOREADD</Event> <Event>EVENT_BEFOREEDIT</Event> <Event>EVENT_BEFORECOPY</Event> </Events> </EventCode> <EventCode type="OTHER" name="Display a message on the Web page" events="all" code=" '********** Display a message on the Web page ************ Response.Write "Your message here" "> <Events/> </EventCode> <EventCode type="DATABASE" name="Save old data record in another table" code=" '********** Save old data record in another table ************ strSQLSave = "INSERT INTO AnotherTable (Field1, Field2) SELECT Field1, Field2 FROM " & strTableName & " where " & where dbConnection.Execute strSQLSave "> <Events> <Event>EVENT_BEFOREDELETE</Event> <Event>EVENT_EDIT_ONLOAD</Event> <Event>EVENT_BEFOREEDIT</Event> <Event>EVENT_COPY_ONLOAD</Event> <Event>EVENT_BEFORECOPY</Event> <Event>EVENT_VIEW_ONLOAD</Event> </Events> </EventCode> <EventCode type="DATABASE" name="Save new data in another table" code=" '********** Save new data in another table ************ strSQLSave = "INSERT INTO AnotherTable (Field1, Field2) values (" strSQLSave = strSQLSave & dict(Field1) & "," strSQLSave = strSQLSave & dict(Field2) strSQLSave = strSQLSave & ")" dbConnection.Execute strSQLSave "> <Events> <Event>EVENT_BEFOREREGISTER</Event> <Event>EVENT_BEFOREADD</Event> <Event>EVENT_BEFOREEDIT</Event> <Event>EVENT_BEFORECOPY</Event> </Events> </EventCode> <EventCode type="DATABASE" name="Insert a record into another table" events="all" code=" '********** Insert a record into another table ************ strSQLInsert = "insert into TableName (Field1, Field2) values (Value1, Value2)" dbConnection.Execute strSQLInsert "> <Events/> </EventCode> <EventCode type="OTHER" name="Redirect to another page" events="all" code=" '********** Redirect to another page ************ Response.Redirect "anypage.asp" "> <Events/> </EventCode> <EventCode type="DATABASE" name="Check if specific record exists" events="all" code=" '********** Check if specific record exists ************ strSQLExists = "select * from AnyTable where AnyColumn='AnyValue'" set rsExists = CreateObject("ADODB.Recordset") rsExists.Open strSQLExists, dbConnection if not rsExists.eof then ' if record exists do something else ' if dont exist do something else end if rsExists.Close : set rsExists = Nothing "> <Events/> </EventCode> <EventCode type="OTHER" name="Custom code" events="all" code=" '********** Custom code ************ ' put your custom code here "> <Events/> </EventCode> </EventCodes> </languages>
[
Íàçàä
]