Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,566 changes: 3,425 additions & 3,141 deletions VB/SimpleCustomFields/CarsDBDataSet.Designer.vb

Large diffs are not rendered by default.

286 changes: 146 additions & 140 deletions VB/SimpleCustomFields/Form1.Designer.vb

Large diffs are not rendered by default.

136 changes: 68 additions & 68 deletions VB/SimpleCustomFields/Form1.vb
Original file line number Diff line number Diff line change
Expand Up @@ -11,80 +11,80 @@ Imports DevExpress.XtraScheduler
#End Region ' #usings

Namespace SimpleCustomFields
Partial Public Class Form1
Inherits Form
Partial Public Class Form1
Inherits Form

Public Sub New()
InitializeComponent()
Public Sub New()
InitializeComponent()

AddHandler schedulerDataStorage1.AppointmentInserting, AddressOf SchedulerStorage1_AppointmentInserting
AddHandler schedulerDataStorage1.AppointmentsInserted, AddressOf OnApptChangedInsertedDeleted
AddHandler schedulerDataStorage1.AppointmentChanging, AddressOf SchedulerStorage1_AppointmentChanging
AddHandler schedulerDataStorage1.AppointmentsChanged, AddressOf OnApptChangedInsertedDeleted
AddHandler schedulerDataStorage1.AppointmentsDeleted, AddressOf OnApptChangedInsertedDeleted
AddHandler schedulerDataStorage1.AppointmentInserting, AddressOf SchedulerStorage1_AppointmentInserting
AddHandler schedulerDataStorage1.AppointmentsInserted, AddressOf OnApptChangedInsertedDeleted
AddHandler schedulerDataStorage1.AppointmentChanging, AddressOf SchedulerStorage1_AppointmentChanging
AddHandler schedulerDataStorage1.AppointmentsChanged, AddressOf OnApptChangedInsertedDeleted
AddHandler schedulerDataStorage1.AppointmentsDeleted, AddressOf OnApptChangedInsertedDeleted

Me.schedulerControl1.Start = New Date(2010, 7, 1)
End Sub
Me.schedulerControl1.Start = New DateTime(2010, 07, 01)
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
' TODO: This line of code loads data into the 'carsDBDataSet.Cars' table. You can move, or remove it, as needed.
Me.carsTableAdapter.Fill(Me.carsDBDataSet_Renamed.Cars)
' TODO: This line of code loads data into the 'carsDBDataSet.CarScheduling' table. You can move, or remove it, as needed.
Me.carSchedulingTableAdapter.Fill(Me.carsDBDataSet_Renamed.CarScheduling)
AddHandler carSchedulingTableAdapter.Adapter.RowUpdated, AddressOf carSchedulingTableAdapter_RowUpdated
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
' TODO: This line of code loads data into the 'carsDBDataSet.Cars' table. You can move, or remove it, as needed.
Me.carsTableAdapter.Fill(Me.carsDBDataSet_Conflict.Cars)
' TODO: This line of code loads data into the 'carsDBDataSet.CarScheduling' table. You can move, or remove it, as needed.
Me.carSchedulingTableAdapter.Fill(Me.carsDBDataSet_Conflict.CarScheduling)
AddHandler carSchedulingTableAdapter.Adapter.RowUpdated, AddressOf carSchedulingTableAdapter_RowUpdated

End Sub
End Sub

Private Sub OnApptChangedInsertedDeleted(ByVal sender As Object, ByVal e As PersistentObjectsEventArgs)
carSchedulingTableAdapter.Update(carsDBDataSet_Renamed)
carsDBDataSet_Renamed.AcceptChanges()
End Sub
Private Sub OnApptChangedInsertedDeleted(ByVal sender As Object, ByVal e As PersistentObjectsEventArgs)
carSchedulingTableAdapter.Update(carsDBDataSet_Conflict)
carsDBDataSet_Conflict.AcceptChanges()
End Sub

Private Sub carSchedulingTableAdapter_RowUpdated(ByVal sender As Object, ByVal e As OleDbRowUpdatedEventArgs)
If e.Status = UpdateStatus.Continue AndAlso e.StatementType = StatementType.Insert Then
Dim id As Integer = 0
Using cmd As New OleDbCommand("SELECT @@IDENTITY", carSchedulingTableAdapter.Connection)
id = DirectCast(cmd.ExecuteScalar(), Integer)
End Using
e.Row("ID") = id
End If
End Sub
#Region "#EditAppointmentFormShowing"
Private Sub schedulerControl1_EditAppointmentFormShowing(ByVal sender As Object, ByVal e As AppointmentFormEventArgs) Handles schedulerControl1.EditAppointmentFormShowing
Dim form As New MyAppointmentForm(TryCast(sender, SchedulerControl), e.Appointment, e.OpenRecurrenceForm)
Try
e.DialogResult = form.ShowDialog()
e.Handled = True
Finally
form.Dispose()
End Try
End Sub
#End Region ' #EditAppointmentFormShowing
Private Sub carSchedulingTableAdapter_RowUpdated(ByVal sender As Object, ByVal e As OleDbRowUpdatedEventArgs)
If e.Status = UpdateStatus.Continue AndAlso e.StatementType = StatementType.Insert Then
Dim id As Integer = 0
Using cmd As New OleDbCommand("SELECT @@IDENTITY", carSchedulingTableAdapter.Connection)
id = DirectCast(cmd.ExecuteScalar(), Integer)
End Using
e.Row("ID") = id
End If
End Sub
#Region "#EditAppointmentFormShowing"
Private Sub schedulerControl1_EditAppointmentFormShowing(ByVal sender As Object, ByVal e As AppointmentFormEventArgs) Handles schedulerControl1.EditAppointmentFormShowing
Dim form As New MyAppointmentForm(TryCast(sender, SchedulerControl), e.Appointment, e.OpenRecurrenceForm)
Try
e.DialogResult = form.ShowDialog()
e.Handled = True
Finally
form.Dispose()
End Try
End Sub
#End Region ' #EditAppointmentFormShowing

#Region "#InitNewAppointment"
Private Sub schedulerControl1_InitNewAppointment(ByVal sender As Object, ByVal e As DevExpress.XtraScheduler.AppointmentEventArgs) Handles schedulerControl1.InitNewAppointment
e.Appointment.Description &= "Created at runtime at " & String.Format("{0:g}", Date.Now)
e.Appointment.CustomFields("Amount") = 0.01R
e.Appointment.CustomFields("ContactInfo") = "someone@somecompany.com"
End Sub
#End Region ' #InitNewAppointment
#Region "#AppointmentInserting"
Private Sub SchedulerStorage1_AppointmentInserting(ByVal sender As Object, ByVal e As PersistentObjectCancelEventArgs)
If CType(e.Object, Appointment).Start < Date.Now Then
e.Cancel = True
End If
End Sub
#End Region ' #AppointmentInserting
#Region "#AppointmentChanging"
Private Sub SchedulerStorage1_AppointmentChanging(ByVal sender As Object, ByVal e As PersistentObjectCancelEventArgs)
If CType(e, DevExpress.XtraScheduler.AdvPersistentObjectCancelEventArgs).PropertyName = "StatusKey" Then
Return
End If
Dim busyKey As Object = schedulerDataStorage1.Appointments.Statuses.GetByType(AppointmentStatusType.Busy).Id
If CType(e.Object, Appointment).StatusKey.Equals(busyKey) Then
e.Cancel = True
End If
End Sub
#End Region ' #AppointmentChanging
End Class
#Region "#InitNewAppointment"
Private Sub schedulerControl1_InitNewAppointment(ByVal sender As Object, ByVal e As DevExpress.XtraScheduler.AppointmentEventArgs) Handles schedulerControl1.InitNewAppointment
e.Appointment.Description &= "Created at runtime at " & String.Format("{0:g}", DateTime.Now)
e.Appointment.CustomFields("Amount") = 00.01R
e.Appointment.CustomFields("ContactInfo") = "someone@somecompany.com"
End Sub
#End Region ' #InitNewAppointment
#Region "#AppointmentInserting"
Private Sub SchedulerStorage1_AppointmentInserting(ByVal sender As Object, ByVal e As PersistentObjectCancelEventArgs)
If CType(e.Object, Appointment).Start < DateTime.Now Then
e.Cancel = True
End If
End Sub
#End Region ' #AppointmentInserting
#Region "#AppointmentChanging"
Private Sub SchedulerStorage1_AppointmentChanging(ByVal sender As Object, ByVal e As PersistentObjectCancelEventArgs)
If CType(e, DevExpress.XtraScheduler.AdvPersistentObjectCancelEventArgs).PropertyName = "StatusKey" Then
Return
End If
Dim busyKey As Object = schedulerDataStorage1.Appointments.Statuses.GetByType(AppointmentStatusType.Busy).Id
If CType(e.Object, Appointment).StatusKey.Equals(busyKey) Then
e.Cancel = True
End If
End Sub
#End Region ' #AppointmentChanging
End Class
End Namespace
96 changes: 49 additions & 47 deletions VB/SimpleCustomFields/My Project/Resources.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 20 additions & 16 deletions VB/SimpleCustomFields/My Project/Settings.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading