Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > .NET 4 and Visual Studio 2010 > .NET 4 and Visual Studio 2010 General Discussions
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
.NET 4 and Visual Studio 2010 General Discussions For discussing anything about .NET 4, WPF, WCF, the rest of the .NET 4 Framework, and Visual Studio 2010 that isn't about a specific Wrox book. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET 4 and Visual Studio 2010 General Discussions section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 1st, 2016, 04:40 PM
Authorized User
Points: 376, Level: 6
Points: 376, Level: 6 Points: 376, Level: 6 Points: 376, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2013
Posts: 84
Thanks: 11
Thanked 0 Times in 0 Posts
Default How do I end CaseParty.Get process and add message"

What I am trying to do is end the CaseParty.Get process when the original @ID is not found. This means it is not found because it was changed.
Also inside the objCaseParty, I want to add a display message "Original party no longer exist on the case.

In my xml document the original CaseParty/@ID was 854 but because this CasePartyName was changed the new CasePArty/@ID is 243. This causes an excelption which is what I want to avoid.
How do I do this?

Here is the CaseParty.Get object I want to make the changes
Code:
objCaseParty = Msc.Integration.Mncis.Library.v4.CaseParty.Get(CInt(aobjXmlInputDoc.DocumentElement.SelectSingleNode("Case/CaseParty[Connection/@BaseConnection='DF']/@ID").InnerText), strCaseNumber, True)
Right now I am getting an Exception "Unknown party for provided case" from running CaseParty.Get process because my xml document original CaseParty (@ID) has been changed.
So this means the original CaseParty.@ID no longer exist.
For that reason, instead of getting an Exception, I want to end CaseParty.Get process. I also want to display text message "The original party (MNCIS Parking) that triggered the NameGet process is no longer on the case."

vb.net sub
Code:
Option Strict On
Option Explicit On
Imports System.Xml
Imports System.Collections.Generic

Public Class BcaNameGet

    Shared Sub main()
        Dim objMessageProcessor As New MessageProcessor
        objMessageProcessor.ProcessInputQueue(False, False)

    End Sub

    Private Class MessageProcessor : Inherits Msc.Integration.MessageBroker.Library.v4.XmlMessageProcessor

        Protected Overrides Sub ProcessMessage(ByRef aobjBroker As MessageBroker.Library.v4.Broker, ByRef aobjXmlInputDoc As System.Xml.XmlDocument, ByRef aobjInstantiatedObjectsCollection As Microsoft.VisualBasic.Collection)
            MyBase.ProcessMessage(aobjBroker, aobjXmlInputDoc, aobjInstantiatedObjectsCollection)
            Dim objSimpleType As Msc.Integration.CourtXml.Library.v4.SimpleType = CType(aobjInstantiatedObjectsCollection.Item("SIMPLETYPE"), Msc.Integration.CourtXml.Library.v4.SimpleType)

            Dim strCitationNumber As String = aobjXmlInputDoc.DocumentElement.SelectSingleNode("Citation/CitationNumber").InnerText
            Dim strIssuingAgency As String = aobjXmlInputDoc.DocumentElement.SelectSingleNode("Citation/Agency/@Word").InnerText
            Dim blnWasEFiled As Boolean = Msc.Integration.Mncis.Library.v4.Citation.WasEFiled(strCitationNumber, strIssuingAgency, True)
            Dim strCaseNumber As String = aobjXmlInputDoc.DocumentElement.SelectSingleNode("Case/CaseNumber").InnerText

            Dim objXmlPersonNameNode As XmlNode = aobjXmlInputDoc.DocumentElement.SelectSingleNode("Case/CaseParty[Connection/@BaseConnection='DF']/CasePartyName")
            Dim objCaseParty As Msc.Integration.Mncis.Library.v4.CaseParty
            Dim objBusinessName As Msc.Integration.Mncis.Library.v4.BusinessName
            Dim objPersonName As Msc.Integration.Mncis.Library.v4.PersonName
            Dim objNickname As Msc.Integration.Mncis.Library.v4.Nickname
            Dim strUser As String = aobjXmlInputDoc.DocumentElement.SelectSingleNode("ControlPoint/@UserID").InnerText
            Dim blnNoRetry As Boolean = False

            'Get the existing party and update with registration name
            objCaseParty = Msc.Integration.Mncis.Library.v4.CaseParty.Get(CInt(aobjXmlInputDoc.DocumentElement.SelectSingleNode("Case/CaseParty[Connection/@BaseConnection='DF']/@ID").InnerText), strCaseNumber, True)
            If objVehicleRegistration.BusinessName.Length > 0 Then
                objBusinessName = New Msc.Integration.Mncis.Library.v4.BusinessName
                objBusinessName.BusinessName = objVehicleRegistration.BusinessName
                objBusinessName.IsCurrent = True
                objCaseParty.AddCasePartyName(CType(objBusinessName, Msc.Integration.Mncis.Library.v4.IName), , True)
            Else
                If objVehicleRegistration.PersonFirstName.Length > 0 Then
                    objPersonName = New Msc.Integration.Mncis.Library.v4.PersonName
                    objPersonName.First = objVehicleRegistration.PersonFirstName
                    objPersonName.Last = objVehicleRegistration.PersonLastName
                    objPersonName.Middle = objVehicleRegistration.PersonMiddleName
                    objPersonName.IsCurrent = True
                    objCaseParty.AddCasePartyName(CType(objPersonName, Msc.Integration.Mncis.Library.v4.IName), , True)
                Else
                    objNickname = New Msc.Integration.Mncis.Library.v4.Nickname
                    objNickname.Nickname = objVehicleRegistration.PersonLastName
                    objNickname.IsCurrent = True
                    objCaseParty.AddCasePartyName(CType(objNickname, Msc.Integration.Mncis.Library.v4.IName), , True)
                End If
                objCaseParty.Party.CurrentDateOfBirth = objVehicleRegistration.PersonBirthDate
            End If
        End Sub
    End Class
End Class
xml document
Code:
<Integration>
	<ControlPoint Timestamp="7/28/2016 11:20:49 AM" UserID="Nope">SAVE-CR-CASE</ControlPoint>
	<Case InternalID="685" ID="14870882" Op="A" xmlns:user="http://tylertechnologies.com">
		<CaseNumber>426</CaseNumber>
		<Court/>
		<CaseParty Op="A" ID="854">
			<Connection Op="A" Word="JRD" BaseConnection="PL" ID="684">
				<Description>Jurisdiction</Description>
				<TimestampCreate Op="A">7/28/2016 11:20:49 AM</TimestampCreate>
				<DateAdded Op="A">07/28/2016</DateAdded>
				<RemovedDate Op="A"/>
				<RemovedReason Op="A" Word=""/>
				<Comment Op="A"/>
			</Connection>
			<CasePartyName Op="A" Current="true" ID="54441" InternalNameID="570">
				<CasePartyNameType Op="A" Word=""/>
				<NameType>Business</NameType>
				<NameLast>State of Minnesota</NameLast>
				<FormattedName>State of Minnesota</FormattedName>
			</CasePartyName>
			<TimestampCreate Op="A">7/28/2016 11:20:49 AM</TimestampCreate>
		</CaseParty>
		<CaseParty Op="A" ID="243">
			<SendNotice Op="A">true</SendNotice>
			<RestrictView Op="A">false</RestrictView>
			<Connection Op="A" Word="DFD" BaseConnection="DF" ID="44919685" InternalCasePartyConnectionID="1651126621">
				<Description>Defendant</Description>
				<TimestampCreate Op="A">7/28/2016 11:20:49 AM</TimestampCreate>
				<DateAdded Op="A">07/28/2016</DateAdded>
				<RemovedDate Op="A"/>
				<RemovedReason Op="A" Word=""/>
				<Comment Op="A"/>
			</Connection>
			<CasePartyName Op="A" Current="true" ID="12121330" InternalNameID="1618922645">
				<CasePartyNameType Op="A" Word=""/>
				<NameType>Standard</NameType>
				<NameFirst>MNCIS</NameFirst>
				<NameLast>Parking</NameLast>
				<FormattedName>Parking, MNCIS</FormattedName>
			</CasePartyName>
			<TimestampCreate Op="A">7/28/2016 11:20:49 AM</TimestampCreate>
		</CaseParty>
	</Case>
	<Citation Op="A" ID="679" xmlns:user="http://tylertechnologies.com">
		<CitationNumber Op="A">549</CitationNumber>
		<CaseTypeKey Op="A" Word="CRM">Crim/Traf Mandatory</CaseTypeKey>
		<Agency Op="A" Word="MN0270300">Brooklyn Park Police Department</Agency>
		<OffenseDate Op="A">07/18/2016</OffenseDate>
		<Vehicle Op="A">
			<VehicleLicensePlateState Op="A">MN</VehicleLicensePlateState>
			<VehicleLicensePlateNumber Op="A">348MAR</VehicleLicensePlateNumber>
		</Vehicle>
	</Citation>
</Integration>
Reply With Quote
  #2 (permalink)  
Old August 3rd, 2016, 09:41 AM
Authorized User
Points: 376, Level: 6
Points: 376, Level: 6 Points: 376, Level: 6 Points: 376, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2013
Posts: 84
Thanks: 11
Thanked 0 Times in 0 Posts
Default

I have resolved this one using Try Catch Exit sub.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to process "embedded2.xml" example with msxsl obmana BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 1 July 24th, 2012 08:03 AM
MSXSL gives error message for "for" inside "select" ilyaz XSLT 1 December 9th, 2010 04:02 PM
"No rule to process file" superherogeek BOOK: Beginning iPad Application Development 0 July 13th, 2010 01:06 PM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 04:56 AM
end process in task mgr bab02 Access 2 September 29th, 2006 06:46 AM



All times are GMT -4. The time now is 12:25 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.