Pulsantedelete_clic
Query privata come stringa
Dim sf As Object = xui.Msgbox2Async("Vuoi realmentee eliminare la prenotazione di " & editnome.Text , "richiesta", "Si", "", "No", Null)
Attendi (sf) Msgbox_Result (risultato come int)
if Result = xui.DialogResponse_Positive then
Query = "DELETE FROM prenota WHERE rowid = " & Id
SQL1.ExecNonQuery(Query)
resetgrafica
resettaorario
Updategiorno
end if
Fine sott
Pulsante registra_Click
Dim query come stringa
Query = "SELECT * FROM prenota WHERE nome = ? AND danascita = ? AND datapren = ?"
ResultSet1 = SQL1.ExecQuery2(Query, Array As String (modificanome.Testo, modificaNascita.Testo, modificapren.Testo))
Se ResultSet1.NextRow = True then
Msgbox2Async("La prenotazione è già esistente, vuoi cambiare l'orario o il giorno?", "Richiesta", "Si", "", "No", Null, False)
Attendi Msgbox_Result (risultato come int)
if risultato = DialogResponse.POSITIVE Allora
if comboprestazioni.SelectedIndex=0 then te= Mod3.temp1
if comboprestazioni.SelectedIndex=1 then te = Mod3.temp2
if comboprestazioni.SelectedIndex=2 thente= Mod3.temp3
testo=Id
Query = "UPDATE prenota set nome = ?, dapren = ?, orario = ?, prestazioni = ?, tempo = ?, danascita = ?, idpren= ? WHERE rowid = " & Id
SQL1.ExecNonQuery2(Query, Array As String(editnome.Text, editpren.Text, combora.SelectedItem, comboprestazioni.SelectedItem, te, EditNascita.text, testo))
ToastMessageShow ("registrato",False)'
updategiorno
else
end if
else
'inserisce nuovo record che funziona perfettamente
end if
'[/CODICE]