A simple enough problem


G

Guest

I have a class I've written that works great as is; however, I now need to
add three additonal fields to it. One of the additional fields is an
integer, as is the case with the already existing field...actually, I guess
property would be the better name for it...anyway; the other two properties
are for date fields. Admittedly, my mind is a bit fried from a lot of
overtime, but I can't figure out how to modify this class for the life of me.
The code is as follows:

Imports System.Configuration
Imports System.Data.SqlClient
Imports Common.DataAccessLayer
Imports Common

Namespace Outreach

<Serializable()> _
Public Class CallEpisodes

#Region " Local variables "

Private _CallEpisodeIds As CallEpisodes

Private Shared _ConnectionString As String = _
ConfigurationManager.ConnectionStrings("EPSDTMain").ToString

#End Region

Sub New(ByVal CallEpisodeIds As CallEpisodes)

_CallEpisodeIds = CallEpisodeIds

End Sub

''' <summary>
''' Retrieves all the Call Episodes associated with a MemberID
''' </summary>
''' <param name="memberID"></param>
''' <returns>A list of all CallEpisodes for this MemberID</returns>
''' <remarks></remarks>
Public Shared Function RetrieveCallEpisodesByMemberId(ByVal memberID
As Integer)

Dim ce As New List(Of Integer)

Dim dr As SqlClient.SqlDataReader =
SqlDataAccess.ExecuteReader(_ConnectionString, _
"Outreach.RetrieveCallEpisodesByMemberId", memberID)

Do While dr.Read()
ce.Add(dr("CallEpisodeID"))
Loop

If dr IsNot Nothing Then
dr.Close()
End If

Return ce

End Function

End Class

End Namespace


How do I go about adding BeginDate, EndDate and ScriptID to this class such
that I can return the information?
 
Ad

Advertisements

J

Jon Skeet [C# MVP]

AlBruAn said:
I have a class I've written that works great as is; however, I now need to
add three additonal fields to it. One of the additional fields is an
integer, as is the case with the already existing field...actually, I guess
property would be the better name for it...anyway; the other two properties
are for date fields. Admittedly, my mind is a bit fried from a lot of
overtime, but I can't figure out how to modify this class for the life of me.

Which bit of it is confusing you? Do you understand how the current
code works?

(One thing to note: your region of "local variables" is actually a
region of instance variables. Local variables are variables declared
within a method.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top