Wrox Programmer Forums
|
Book: C# 2008 Programmer's Reference ISBN: 978-0-470-28581-7
This is the forum to discuss the Wrox book C# 2008 Programmer's Reference by Wei-Meng Lee; ISBN: 9780470285817
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Book: C# 2008 Programmer's Reference ISBN: 978-0-470-28581-7 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 November 8th, 2009, 05:33 AM
Authorized User
 
Join Date: Jul 2008
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hashtable

hello,

I have vb.net code as below
can any one help me to convert it into c# 2008.
I am having problem that how to use multiple hashtable? means hashtable into hashtable? i am very confuced. thanks in advance.
Code:
   Private Shared Function getPatientDetail(ByVal Ticket As String) As Boolean
        Dim objDr As OleDb.OleDbDataReader
        Dim patient As PatientHeader
        Dim createNewPatient As Boolean
        Try
            getPatientDetail = False
            createNewPatient = False
            objDr = StatementCommon.AcCmd.GetReader(getSQLPatientDetail(Ticket))
            If objDr.HasRows Then
                StatementCommon.ObjLogWriter.AddToReport("Message : GetPatientDetail: Getting Information for  Ticket NO:  " & Ticket) ' 1.0.8a
                While objDr.Read()
                    If _patientCount = 0 Then
                        createNewPatient = True
                        _patientCount = _patientCount + 1
                        patient = New PatientHeader
                        _filehdr.StatementHeaderCollection.Item(_filehdr.StatementHeaderCollection.Count).PatientHeaderCollection.Add(_patientCount, patient)
                        _ticketCount = 0
                        _transactionCount = 0
                    Else
                        If DirectCast(_filehdr.StatementHeaderCollection.Item(_statementCount).PatientHeaderCollection.Item(_patientCount).PatientNumber, String).Trim() <> DataCheck.NullString(objDr.Item("PatientNo")).Trim() Then
                            createNewPatient = True
                            _patientCount += 1
                            patient = New PatientHeader
                            _filehdr.StatementHeaderCollection.Item(_filehdr.StatementHeaderCollection.Count).PatientHeaderCollection.Add(_patientCount, patient)
                            _ticketCount = 0
                            _transactionCount = 0
                        End If
                    End If
                    With _filehdr.StatementHeaderCollection.Item(_statementCount).PatientHeaderCollection.Item(_patientCount)
                        .RecordType = "P"
                        .PatientNumber = IIf(DataCheck.NullString(objDr.Item("PatientNo")) <> String.Empty, DataCheck.NullString(objDr.Item("PatientNo")), .PatientNumber)
                        .PatientFirstName = IIf(DataCheck.NullString(objDr.Item("PatientFirstName")) <> String.Empty, DataCheck.NullString(objDr.Item("PatientFirstName")), .PatientFirstName)
                        .PatientMI = IIf(DataCheck.NullString(objDr.Item("PatientMI")) <> String.Empty, DataCheck.NullString(objDr.Item("PatientMI")), .PatientMI)
                        .PatientLastName = IIf(DataCheck.NullString(objDr.Item("PatientLastName")) <> String.Empty, DataCheck.NullString(objDr.Item("PatientLastName")), .PatientLastName)
                        .PatientSSN = IIf(DataCheck.NullString(objDr.Item("PatientSSN")) <> String.Empty, DataCheck.NullString(objDr.Item("PatientSSN")), .PatientSSN)
                        .PatientPhone = IIf(DataCheck.NullString(objDr.Item("PatientPhone")) <> String.Empty, DataCheck.NullString(objDr.Item("PatientPhone")), .PatientPhone)
                        .PatientPrimIns = IIf(DataCheck.NullString(objDr.Item("PrimInsName")) <> String.Empty, DataCheck.NullString(objDr.Item("PrimInsName")), .PatientPrimIns)
                        .PatientSecIns = IIf(DataCheck.NullString(objDr.Item("SecInsName")) <> String.Empty, DataCheck.NullString(objDr.Item("SecInsName")), .PatientSecIns)
                        .PatientAddressLine1 = IIf(DataCheck.NullString(objDr.Item("PatientAddressLine1")) <> String.Empty, DataCheck.NullString(objDr.Item("PatientAddressLine1")), .PatientAddressLine1)
                        .PatientAddressLine2 = IIf(DataCheck.NullString(objDr.Item("PatientAddressLine2")) <> String.Empty, DataCheck.NullString(objDr.Item("PatientAddressLine2")), .PatientAddressLine2)
                        .PatientCity = IIf(DataCheck.NullString(objDr.Item("PatientCity")) <> String.Empty, DataCheck.NullString(objDr.Item("PatientCity")), .PatientCity)
                        .PatientState = IIf(DataCheck.NullString(objDr.Item("PatientState")) <> String.Empty, DataCheck.NullString(objDr.Item("PatientState")), .PatientState)
                        .PatientZip = IIf(DataCheck.NullString(objDr.Item("PatientZip")) <> String.Empty, DataCheck.NullString(objDr.Item("PatientZip")), .PatientZip)
                        .PatientTotalDouble = 0.0
                    End With
                End While
            End If
            If _filehdr.StatementHeaderCollection.Item(_statementCount).PatientHeaderCollection.Item(_patientCount).HasError = False And _filehdr.StatementHeaderCollection.Item(_statementCount).PatientHeaderCollection.Item(_patientCount).HasTicketError = False Then
                getPatientDetail = True
            End If
        Catch ex As Exception
            StatementCommon.ObjExpWriter.WriteExceptions(ex, "GETStatementDetail")
            getPatientDetail = False
        Finally
            If Not IsNothing(objDr) Then
                If Not objDr.IsClosed Then objDr.Close()
            End If
        End Try
    End Function





Similar Threads
Thread Thread Starter Forum Replies Last Post
Hashtable ajit Java Basics 1 July 11th, 2006 01:25 AM
Hashtable Scott Rider General .NET 7 July 3rd, 2005 02:25 AM
Hashtable mahulda General .NET 2 August 2nd, 2004 07:49 AM
Hashtable in C# sachin-csharp .NET Framework 2.0 0 July 28th, 2004 01:45 AM
about hashtable csc820203 C# 1 July 11th, 2004 07:44 PM





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