c6a9cd69c2
* NEW: Add examples again. I hope correctly this time. git-svn-id: svn://localhost/gambas/trunk@6726 867c0c6c-44f3-4631-809d-bfa615b0a4ec
51 lines
961 B
Text
51 lines
961 B
Text
' Gambas class file
|
|
|
|
Private $sEvent As String
|
|
Private $bEdit As Boolean = False
|
|
|
|
Public Sub _new(Optional {Event} As String)
|
|
|
|
If {Event} Then
|
|
$sEvent = {Event}
|
|
$bEdit = True
|
|
Endif
|
|
|
|
End
|
|
|
|
Public Sub Form_Open()
|
|
|
|
If $bEdit Then
|
|
txtName.Enabled = False
|
|
Me.Text = ("Edit Event")
|
|
lblTitle.Text = Me.Text
|
|
txtName.Text = $sEvent
|
|
txtSchedule.Text = modMain.$Connection.MySQL.Event.Schedule($sEvent)
|
|
txtData.Text = modMain.$Connection.MySQL.Event.Definition($sEvent)
|
|
Else
|
|
txtData.Text = "BEGIN\n \nEND"
|
|
Endif
|
|
|
|
End
|
|
|
|
Public Sub btnCancel_Click()
|
|
|
|
Me.Close()
|
|
|
|
End
|
|
|
|
Public Sub tbnOK_Click()
|
|
|
|
modMain.$Connection.MySQL.Event.Add(txtName.Text, txtSchedule.Text, txtData.Text, IIf($bEdit, True, False))
|
|
Me.Close()
|
|
Catch
|
|
modMain.Error()
|
|
|
|
End
|
|
|
|
Public Sub btnClue_Click()
|
|
|
|
txtName.Text = "FooEvent"
|
|
txtSchedule.Text = "EVERY 1 DAY STARTS NOW()"
|
|
txtData.Text = "BEGIN\n SELECT `User` FROM `mysql`.`user`;\nEND"
|
|
|
|
End
|