0
私はリストからアポイントメントを削除したいが、私はそれを私のデータベースから削除しないでください。私はこのコードを使用しますが、動作しません。カスタム削除手続きdevexpressスケジュール
Private Sub schedulerControl_DeleteAppointmentFormShowing(sender As Object, e As AppointmentFormEventArgs) Handles schedulerControl.DeleteRecurrentAppointmentFormShowing
Dim scheduler As DevExpress.XtraScheduler.SchedulerControl = CType(sender, DevExpress.XtraScheduler.SchedulerControl)
Try
If koneksiDB.State = ConnectionState.Open Then
'proses simpan DB
Dim cmd As New SqlCommand("update Appointments set isdeleted = 1 where UniqueID = @Kode", koneksiDB)
Dim apt As Appointment = schedulerControl.SelectedAppointments(0)
Dim dr As DataRowView = CType(apt.GetSourceObject(schedulerStorage), DataRowView)
Dim id As Integer = Convert.ToInt64(dr("UniqueID"))
cmd.Parameters.AddWithValue("kode", id)
cmd.ExecuteNonQuery()
RefreshDB()
Else
MsgBox("Maaf koneksi dengan database terputus. harap memperbaiki koneksi terlebih dahulu.")
End If
Catch ex As Exception
MsgBox("Maaf, terjadi permasalahan teknis :" & Chr(13) & ex.Message & Chr(13) & Chr(13) & "Silakan catat dan hubungi pihak teknisi bila diperlukan.", MsgBoxStyle.Exclamation)
End Try
End Sub
を忘れないでください – Plutonix