Question to codes

Hi,
Here is the class
Public Class YearlySalesByShoesTypeMonth
    Public Sub New(Year As Integer, Month As Integer, Parent As YearlySalesByShoesTypeShoesType)
        fYear = Year
        fMonth = Month
        fShoesTypes = Parent
        fProducts = New List(Of String)
    End Sub

    Private fProducts As List(Of String)
    Public ReadOnly Property Products As List(Of String)
        Get
            Return fProducts
        End Get
    End Property

    Private fShoesTypes As YearlySalesByShoesTypeShoesType
    Public ReadOnly Property ShoesTypes As YearlySalesByShoesTypeShoesType
        Get
            Return fShoesTypes
        End Get
    End Property

    Private fYear As Integer = 0
    Public ReadOnly Property Year() As Integer
        Get
            Return fYear
        End Get
    End Property

    Private fMonth As Integer = 0
    Public ReadOnly Property Month() As Integer
        Get
            Return fMonth
        End Get
    End Property

    Public ReadOnly Property PeriodKey As String
        Get
            Return String.Format("{0:0000}-{1:00}", Year, Month)
        End Get
    End Property

    Private fSalesQty As Integer = 0
    Public Property SalesQty() As Integer
        Get
            Return fSalesQty
        End Get
        Set(ByVal value As Integer)
            fSalesQty = value
        End Set
    End Property

    Public ReadOnly Property SalesQtyShare As Double
        Get
            Dim total As Integer = ShoesTypes.ProductTypes.SalesQtyOfMonth(Year, Month)
            If total = 0 Then Return 0
            Return SalesQty / total
        End Get
    End Property

    Private fSalesAmount As Double = 0
    Public Property SalesAmount() As Double
        Get
            Return fSalesAmount
        End Get
        Set(ByVal value As Double)
            fSalesAmount = value
        End Set
    End Property

    Public ReadOnly Property SalesAmountShare As Double
        Get
            Dim total As Integer = ShoesTypes.ProductTypes.SalesAmountOfMonth(Year, Month)
            If total = 0 Then Return 0
            Return SalesAmount / total
        End Get
    End Property

    Private fStockQty As Integer = 0
    Public Property StockQty() As Integer
        Get
            Return fStockQty
        End Get
        Set(ByVal value As Integer)
            fStockQty = value
        End Set
    End Property

    Public ReadOnly Property StockQtyShare As Double
        Get
            Dim total As Integer = ShoesTypes.ProductTypes.StockQtyOfMonth(Year, Month)
            If total = 0 Then Return 0
            Return StockQty / total
        End Get
    End Property

    Public ReadOnly Property SkuCount As Integer
        Get
            Return Products.Count
        End Get
    End Property

    Public ReadOnly Property SkuShare As Double
        Get
            Dim total As Integer = ShoesTypes.ProductTypes.SkuCountOfMonth(Year, Month)
            If total = 0 Then Return 0
            Return SkuCount / total
        End Get
    End Property

    Public ReadOnly Property AveragePrice As Double
        Get
            If SalesQty = 0 Then Return 0
            Return SalesAmount / SalesQty
        End Get
    End Property

    Public Sub DataRowToProperty(row As System.Data.DataRow, Optional dataIndex As Integer = 0)
        If dataIndex = 0 Then
            SalesQty += row("nqty")
            SalesAmount += row("damount")
        Else
            Dim productId As String = row(PRODUCTCODE_FIELD.AliasName).ToString.Trim
            If Not Products.Contains(productId) Then Products.Add(productId)
            StockQty += row("nqty")
        End If
    End Sub
End Class

Open in new window

how can I understand below

For Each monthData As YearlySalesByShoesTypeMonth In shoestype
...

Open in new window


through which records the For loop is scanning?
LVL 12
HuaMin ChenProblem resolverAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AndyAinscowFreelance programmer / ConsultantCommented:
For Each monthData As YearlySalesByShoesTypeMonth In shoestype

You have an instance variable of a collection (list, array, dictionary....) which is called shoestype.
For each item in that collection you are getting a temporary variable which you call monthData and that is of the class YearlySalesByShoesTypeMonth - in other words the functionality of YearlySalesByShoesTypeMonth is available for the variable monthData
HuaMin ChenProblem resolverAuthor Commented:
Thanks. if we refer to the class in above, what records are being looped, due to such condition below?

YearlySalesByShoesTypeMonth In shoestype
AndyAinscowFreelance programmer / ConsultantCommented:
To repeat myself:  For each item in that collection
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

AndyAinscowFreelance programmer / ConsultantCommented:
Do you now understand what a For loop is?
käµfm³d 👽Commented:
* No Points *

Screenshot

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
käµfm³d 👽Commented:
Can you show the declaration of shoestype?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.