Click here to Skip to main content
15,892,737 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
Imports System.Collections.Specialized


Namespace LightSwitchApplication

    Public Class SelectPeopleToMail

        Private Sub SelectPeopleToMail_InitializeDataWorkspace(saveChangesTo As System.Collections.Generic.List(Of Microsoft.LightSwitch.IDataService))
            If Me.MailListName Is Nothing = False Then
                prmMailListName = Me.MailListName
            End If
            If Me.IncludeSecondary = True Then
                prmIncludeSecondaries = True
            Else
                prmIncludeSecondaries = False
            End If
            If Me.IncludeExternal = True Then
                prmIncludeExternals = True
            Else
                prmIncludeExternals = False
            End If
        End Sub

        Private Sub GetPeopleToMailSelected_Changed(e As System.Collections.Specialized.NotifyCollectionChangedEventArgs)
            Me.ptyRecordCount = Me.GetPeopleToMailSelected.Count

        End Sub

        Private Sub CreateFileForMailService_Execute()
            Dim props As New List(Of String)()

            For Each prop In Me.GetPeopleToMailSelected.SelectedItem.Details.Properties.All.OfType(Of Details.IEntityStorageProperty)()
                Select Case prop.Name
                    Case "ID", "MailListName", "MailCodeName", "IsSecondary", "Salutation", "NameSuffix"
                        'Skip these fields
                        'Note that the initial users of PeopleTrac chose to ignore Salutation and NameSuffix
                    Case Else
                        props.Add(prop.Name)
                End Select

               
            Next

            GeneralImportExport.EntityImportExport.PromptAndExportEntities(Me.DataWorkspace.WCF_RIA_ServiceData.GetPeopleToMailSelected(Me.MailListName, IncludeSecondary, IncludeExternal), props.ToArray())

        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