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 January 26th, 2015, 12:07 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 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.
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.
Reply With Quote
  #2 (permalink)  
Old January 27th, 2015, 01:28 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

This is how I resolved this issue:

Code:
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
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
Help with Case Statement eastwest SQL Server 2005 8 August 6th, 2009 06:19 PM
Case statement cole SQL Language 3 May 8th, 2005 04: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 04:03 PM



All times are GMT -4. The time now is 09:12 AM.


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