Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
750
Sample App - Bind GenericDataProvider to ICollection
posted

Can you provide the VB code for MyAppointment and MyResource for this sample, this appears to be missing.

http://es.infragistics.com/samples/aspnet/schedule/bind-genericdataprovider-to-icollection

    Private Function GetAppointments(resources As IList) As IList
        Dim appointments As New List(Of MyAppointment)()

        appointments.Add(CreateAppointment(1, DateTime.Today.AddHours(9), 3600, "Sales Expo", "NYC", "Description", _
            False, (DirectCast(resources(0), MyResource)).ID.ToString()))

        appointments.Add(CreateAppointment(2, DateTime.Today.AddDays(3).AddHours(14), 4000, "Win 7 Rollout ", "US", "Description", _
            False, (DirectCast(resources(0), MyResource)).ID.ToString()))

        appointments.Add(CreateAppointment(3, DateTime.Today.AddDays(5).AddHours(11), 4600, "Finalise Merger", "Milan", "Description", _
            False, (DirectCast(resources(0), MyResource)).ID.ToString()))


        appointments.Add(CreateAppointment(4, DateTime.Today.AddDays(10).AddHours(13), 3600, "Tour Sites", "India", "Description", _
            False, (DirectCast(resources(1), MyResource)).ID.ToString()))


        appointments.Add(CreateAppointment(5, DateTime.Today.AddDays(-3).AddHours(10), 4600, "Roadshow", "Abu Dhabi", "Description", _
            False, (DirectCast(resources(1), MyResource)).ID.ToString()))

        appointments.Add(CreateAppointment(6, DateTime.Today.AddDays(-10).AddHours(13), 3200, "VC Golf", "Country Club", "Description", _
            False, (DirectCast(resources(1), MyResource)).ID.ToString())) appointments.Add(CreateAppointment(7, DateTime.Today.AddDays(-15).AddHours(13), 3600, "Conf Call", "London", "Description", _
            False, (DirectCast(resources(2), MyResource)).ID.ToString()))

        appointments.Add(CreateAppointment(8, DateTime.Today.AddDays(-20).AddHours(9), 3600 * 24 * 2, "DevReach Conference", "Sofia", "The fourth edition of the premier developer conference on Microsoft technologies in SEE", _
            True, (DirectCast(resources(2), MyResource)).ID.ToString()))

        Return appointments
    End Function

    Private Function GetResources() As IList
        Dim resources As New List(Of MyResource)()

        resources.Add(New MyResource(1, "Allyson Tuley", "Allyson Tuley", "aTuley@resources.com"))
        resources.Add(New MyResource(2, "Ted Redfern", "Ted Redfern", "tRedfern@resources.com"))
        resources.Add(New MyResource(3, "Jamie Gadomski", "Jamie Gadomski", "jGadomski@resources.com"))

        Return resources
    End Function

    Protected Function CreateAppointment(id As Integer, startDateTime As DateTime, appointmentDuration As Integer, appName As String, location As String, appDescription As String, _
        allDayEvent As Boolean, resourceID As String) As MyAppointment
        Return New MyAppointment(id, startDateTime.ToUniversalTime(), appointmentDuration, appName, allDayEvent, location, _
            appDescription, 1, False, 1, 1, Guid.NewGuid().ToString(), _
            Nothing, -1, Nothing, resourceID)
    End Function

  • 435
    posted

    Hello Monica,

    Thank you for contacting Infragistics!

    I am attaching .cs files with the implementation of both classes MyAppointment and MyResources. I hope you will benefit from them. I am not able to provide Visual Basic code, but you could use online converter from C# to Visual Basic code.

    Let me know if I may be of further assistance.

    WebSchedule.zip