Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 4 and Visual Studio 2010 > .NET 4 and Visual Studio 2010 General Discussions
.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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 26th, 2015, 12:07 PM
Friend of Wrox
Join Date: Apr 2013
Posts: 101
Thanks: 14
Thanked 0 Times in 0 Posts
Default How can I use if statement to check if po user send is the same as one in the case?

I would like to check to see if the po number the user submitted is the same as the one in the case using if statement. If the po number is not the same, I want to throw an exception "PO Number does not match the one in the case"

The case is an xml document saved in objXmlCaseDoc.

Here is my vb code.

Public Class BcaPoRequests

   Private Class MessageProcessor

            Dim objXmlMessageDoc As XmlDocument
            Dim objXmlMessageNode As XmlNode
            Dim objNameTable As NameTable
            Dim objXMLNameSpaceManager As XmlNamespaceManager
            Dim objXMLSchemaException As Xml.Schema.XmlSchemaException
            Dim strCaseNumber As String
            Dim strPoNumber As String
            Dim objXmlCaseDoc As XmlDocument
            Dim objXMLOutputSoapEnvelopeDoc As XmlDocument

            'Check if the PO on this case is the same as the one user submitted
            'How do I use a if statement to see if the PO submitted is the same as the one in the case?

    End Class

End Class

Last edited by winkimjr2; January 27th, 2015 at 01:27 PM..
Old January 27th, 2015, 01:28 PM
Friend of Wrox
Join Date: Apr 2013
Posts: 101
Thanks: 14
Thanked 0 Times in 0 Posts

This is how I resolved this issue:

If objXmlCaseDoc.DocumentElement.SelectSingleNode("ProtectionOrder[ProtectionOrderNumber='" + strPoNumber + "']", objXMLNameSpaceManager) Is Nothing Then

                aobjBroker.Reply(aobjBroker.CreateSoapFault(Msc.Integration.Utility.Library.v4.Soap.udtSoapCodes.Sender, "Protection Order " + strPoNumber + " for case " + strCaseNumber + " not found.", Msc.Integration.Utility.Library.v4.Soap.udtSoapRoles.RoleUltimateReceiver, aobjXMLInputSoapEnvelopeDoc, "soap:InvalidMessage", "soap:Body", Msc.Integration.Utility.Library.v4.Soap.GetReplyEndpointReference(aobjXMLInputSoapEnvelopeDoc), aobjXMLInputSoapEnvelopeDoc.DocumentElement.SelectSingleNode("soap:Header/wsa:MessageID", objXMLNameSpaceManager).InnerText, aobjConsumer))
                Exit Sub
            End If

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Case Statement eastwest SQL Server 2005 8 August 6th, 2009 05:19 PM
Case statement cole SQL Language 3 May 8th, 2005 03:02 PM
Check Case in a Case-Insensitive DB nbryson SQL Language 1 January 23rd, 2004 07:36 AM
Using A CASE Statement fastcorvette Access 5 December 24th, 2003 01:39 PM
case statement jakeone Beginning PHP 10 August 19th, 2003 03:03 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.