|
Namespace LightSwitchApplication
Public Class ApplicationDataService
Private Sub Subscriptions_Updating(entity As Subscription)
End Sub
Private Sub ActiveSeasons_PreprocessQuery(ByRef query As System.Linq.IQueryable(Of LightSwitchApplication.Season))
'query = From mySeason In query
' Where mySeason.Year >= Date.Today.Year - 3
' Select mySeason
End Sub
Private Sub MailListGeneral_PreprocessQuery(ByRef query As System.Linq.IQueryable(Of LightSwitchApplication.Person))
'query = From myList In query
' Select myList.NamePrefix, myList.FirstName, myList.LastName, _
' myList.Address1, myList.Address2, myList.City, myList.State, myList.Zip
End Sub
Private Sub PeopleCountsByMailcode_PreprocessQuery(ByRef query As System.Linq.IQueryable(Of LightSwitchApplication.Person))
'SELECT TOP (100) PERCENT MAX(dbo.People.Id) AS ID, dbo.MailCodes.MailCodeName, COUNT(dbo.People.Id) AS Count
'FROM dbo.People INNER JOIN
' dbo.MailCodes ON dbo.People.Person_MailCode = dbo.MailCodes.Id
'GROUP BY dbo.MailCodes.MailCodeName
'ORDER BY dbo.MailCodes.MailCodeName
End Sub
Private Sub ImportPersons_Validate(entity As ImportPerson, results As EntitySetValidationResultsBuilder)
If entity.BestPrimaryMatchID Is Nothing Then
entity.BestPrimaryMatchID = 0
End If
If entity.BestPrimaryMatchScore Is Nothing Then
entity.BestPrimaryMatchScore = 0
End If
If entity.ExistingPersonLastName Is Nothing Then
entity.ExistingPersonLastName = "No match"
End If
If entity.ExistingPersonAddress1 Is Nothing Then
entity.ExistingPersonAddress1 = "No match"
End If
If entity.ExistingPersonAddress2 Is Nothing Then
entity.ExistingPersonAddress2 = "No match"
End If
If entity.ExistingPersonCity Is Nothing Then
entity.ExistingPersonCity = "No Match"
End If
If entity.ExistingPersonZip Is Nothing Then
entity.ExistingPersonZip = "No match"
End If
If entity.Address2 Is Nothing Then
entity.Address2 = ""
End If
If entity.BusinessPhone Is Nothing Then
entity.BusinessPhone = ""
End If
If entity.City Is Nothing Then
entity.City = ""
End If
If entity.Company Is Nothing Then
entity.Company = ""
End If
If entity.Donation Is Nothing Then
entity.Donation = 0
End If
If entity.Email Is Nothing Then
entity.Email = ""
End If
If entity.HomePhone Is Nothing Then
entity.HomePhone = ""
End If
If entity.MatchesExistingPerson Is Nothing Then
entity.MatchesExistingPerson = False
End If
If entity.UpdateAddress Is Nothing Then
entity.UpdateAddress = False
End If
If entity.MobilPhone Is Nothing Then
entity.MobilPhone = ""
End If
If entity.NameSuffix Is Nothing Then
entity.NameSuffix = ""
End If
If entity.Salutation Is Nothing Then
entity.Salutation = ""
End If
If entity.State Is Nothing Then
entity.State = ""
End If
If entity.SubscriptionQty Is Nothing Or
entity.SubscriptionQty < 1 Then
entity.SubscriptionQty = 1
End If
End Sub
Private Sub People_Validate(entity As Person, results As Microsoft.LightSwitch.EntitySetValidationResultsBuilder)
If entity.Address2 Is Nothing Then
entity.Address2 = ""
End If
If entity.BusinessPhone Is Nothing Then
entity.BusinessPhone = ""
End If
If entity.City Is Nothing Then
entity.City = ""
End If
If entity.Company Is Nothing Then
entity.Company = ""
End If
If entity.Email Is Nothing Then
entity.Email = ""
End If
If entity.HomePhone Is Nothing Then
entity.HomePhone = ""
End If
If entity.MobilPhone Is Nothing Then
entity.MobilPhone = ""
End If
If entity.NameSuffix Is Nothing Then
entity.NameSuffix = ""
End If
If entity.Salutation Is Nothing Then
entity.Salutation = ""
End If
End Sub
Private Sub ExternalMailPersons_Validate(entity As ExternalMailPerson, results As EntitySetValidationResultsBuilder)
If entity.BestPrimaryMatchID Is Nothing Then
entity.BestPrimaryMatchID = 0
End If
If entity.BestPrimaryMatchScore Is Nothing Then
entity.BestPrimaryMatchScore = 0
End If
If entity.ExistingPersonLastName Is Nothing Then
entity.ExistingPersonLastName = "No match"
End If
If entity.ExistingPersonAddress1 Is Nothing Then
entity.ExistingPersonAddress1 = "No match"
End If
If entity.ExistingPersonAddress2 Is Nothing Then
entity.ExistingPersonAddress2 = "No match"
End If
If entity.ExistingPersonCity Is Nothing Then
entity.ExistingPersonCity = "No Match"
End If
If entity.ExistingPersonZip Is Nothing Then
entity.ExistingPersonZip = "No match"
End If
If entity.Address2 Is Nothing Then
entity.Address2 = ""
End If
If entity.City Is Nothing Then
entity.City = ""
End If
If entity.Company Is Nothing Then
entity.Company = ""
End If
If entity.MatchesExistingPerson Is Nothing Then
entity.MatchesExistingPerson = False
End If
If entity.NameSuffix Is Nothing Then
entity.NameSuffix = ""
End If
If entity.Salutation Is Nothing Then
entity.Salutation = ""
End If
If entity.State Is Nothing Then
entity.State = ""
End If
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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.