Click here to Skip to main content
15,891,905 members
Articles / Programming Languages / Visual Basic

PeopleTrac – People Management for Not-For-Profit Organizations

Rate me:
Please Sign up or sign in to vote.
4.91/5 (10 votes)
3 Jan 2012CPOL6 min read 24K   877   13  
Demonstrates several LightSwitch capabilities including WCF-RIA services, Native SQL, Name and Addres merge purge

Namespace LightSwitchApplication

    Public Class AddAndEditPerson

        Private Sub AddAndEditPerson_InitializeDataWorkspace(saveChangesTo As System.Collections.Generic.List(Of Microsoft.LightSwitch.IDataService))
            ' Write your code here.
            If Me.ptyPersonID.HasValue Then
                Me.PersonProperty = Me.Person
            Else
                Me.PersonProperty = New Person()
                Dim mc = From c1 In Me.DataWorkspace.ApplicationData.MailCodes
                               Where c1.IsDefault = True

                Me.PersonProperty.MailCode = mc.FirstOrDefault
            End If


           

        End Sub

        Private Sub AddAndEditPerson_Saved()
            ' Write your code here.
            Me.Close(False)
            Application.Current.ShowDefaultScreen(Me.PersonProperty)
        End Sub

        Private Sub SubscriptionsAddAndEditNew_CanExecute(ByRef result As Boolean)
            ' Write your code here.

        End Sub

       
        Private Sub SubscriptionsAddNew_CanExecute(ByRef result As Boolean)
            ' Write your code here.

        End Sub

        Private Sub SubscriptionsAddNew_Execute()
            ' Write your code here.
            Me.Application.ShowCreateAndEditSubscription(Me.PersonProperty.Id, Nothing)
        End Sub

        Private Sub SubscriptionsEditSelected_CanExecute(ByRef result As Boolean)
            ' Write your code here.

        End Sub

        Private Sub SubscriptionsEditSelected_Execute()
            ' Write your code here.
            Me.Application.ShowCreateAndEditSubscription(Me.PersonProperty.Id, Me.Subscriptions.SelectedItem.Id)
        End Sub

        Private Sub AddAndEditPerson_Closing(ByRef cancel As Boolean)
            ' Write your code here.
            '    ShowMessageBox("AddAndEditPerson is closing")


        End Sub

      
        '    Private Sub ProgramsAddAndEditNew_Execute()
        '        ' Write your code here.
        '        Dim x As Integer = 1
        '        If Me.Programs.SelectedItem Is Nothing Then
        '            Me.Application.ShowCreateAndEditProgamActivity(Me.PersonProperty.Id, Nothing)
        '        Else
        '            Me.Application.ShowCreateAndEditProgamActivity(Me.PersonProperty.Id, Me.Programs.SelectedItem.Id)

        '        End If
        '    End Sub

        Private Sub ProgramsAddNew_CanExecute(ByRef result As Boolean)
            ' Write your code here.

        End Sub

        Private Sub ProgramsAddNew_Execute()
            ' Write your code here.
            Me.Application.ShowCreateAndEditProgamActivity(Me.PersonProperty.Id, Nothing)
        End Sub

        Private Sub ProgramsEditSelected_CanExecute(ByRef result As Boolean)
            ' Write your code here.

        End Sub

        Private Sub ProgramsEditSelected_Execute()
            ' Write your code here.
            Me.Application.ShowCreateAndEditProgamActivity(Me.PersonProperty.Id, Me.Programs.SelectedItem.Id)
        End Sub
    End Class

End Namespace

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions