tpotter12
05-05-2010, 07:49 AM
he title is basically the google search I've been performing; but I've not found an example yet. I really do hope its possible.
I am utilizing a web service to pull down data to excel.
The web service defines some structures that I iterate through to populate the data, send it down to excel, then I iterate through the variants and define using the web service provided structures.
I would like to then send the same object back to the web service.
The parent structure object looks like this:
Public Structure FixtureFillData
Public LadderID As Integer
Public YearNumber As Integer
Public FixtureFillSeasons() As FixtureFillSeason
End Structure
The FixtureFillSeason structure looks like this:
Public Structure FixtureFillSeason
Public SeasonChar As String
Public LYDoorCtr As Integer
Public FixtureFillMonth1_Percent As Decimal
Public FixtureFillMonth2_Percent As Decimal
Public FixtureFillMonth3_Percent As Decimal
Public FixtureFillMonth4_Percent As Decimal
Public FixtureFillMonth5_Percent As Decimal
Public FixtureFillMonth6_Percent As Decimal
Public WorksheetSalesPlanNumber As Integer
Public ProjectCtdUnitQuantity As Integer
Public StartRegularOnHandQuantity As Integer
Public StartClearanceOnHandQuantity As Integer
Public StartFinalOnHandQuantity As Integer
Public LastModifiedTimeStamp As DateTime
Public LastModifedID As String
Public ClusterInfo() As ClusterData
End Structure
In this example, I want to create many FixtureFillSeason instances and put them into the parent structure - then send the parent structure back to the web service.
Public Sub SaveFixtureFill()
'Save all of the fixture fill data
Dim FFObj As New struct_FixtureFillData
FFObj.LadderID = "12453"
FFObj.YearNumber = "2010"
'Set up the three seasons
Dim FFSeason1 As New struct_FixtureFillSeason
FFSeason1.FixtureFillMonth1_Percent = Range("H9")
FFSeason1.FixtureFillMonth2_Percent = Range("H10")
FFSeason1.FixtureFillMonth3_Percent = Range("H11")
FFSeason1.FixtureFillMonth4_Percent = Range("H12")
FFSeason1.FixtureFillMonth5_Percent = Range("H13")
FFSeason1.FixtureFillMonth6_Percent = Range("H14")
FFSeason1.LastModifedID = "LDDRUSR"
FFSeason1.LastModifiedTimeStamp = DateTime.Now
FFSeason1.LYDoorCtr = 45
FFSeason1.ProjectCtdUnitQuantity = 46
FFSeason1.SeasonChar = "1"
FFSeason1.StartClearanceOnHandQuantity = 2353
FFSeason1.StartFinalOnHandQuantity = 3882
FFSeason1.StartRegularOnHandQuantity = 3885
FFSeason1.WorksheetSalesPlanNumber = 3
FFObj.FixtureFillSeasons(0) = FFSeason1
Dim FIXFILLWS As New clsws_WSLadderPlan
FIXFILLWS.wsm_UpdateFixtureFillData (FFObj)
End Sub
I realize there is some initialization needed - but you hopefully this provides enough data to understand what I am trying to do.
I am utilizing a web service to pull down data to excel.
The web service defines some structures that I iterate through to populate the data, send it down to excel, then I iterate through the variants and define using the web service provided structures.
I would like to then send the same object back to the web service.
The parent structure object looks like this:
Public Structure FixtureFillData
Public LadderID As Integer
Public YearNumber As Integer
Public FixtureFillSeasons() As FixtureFillSeason
End Structure
The FixtureFillSeason structure looks like this:
Public Structure FixtureFillSeason
Public SeasonChar As String
Public LYDoorCtr As Integer
Public FixtureFillMonth1_Percent As Decimal
Public FixtureFillMonth2_Percent As Decimal
Public FixtureFillMonth3_Percent As Decimal
Public FixtureFillMonth4_Percent As Decimal
Public FixtureFillMonth5_Percent As Decimal
Public FixtureFillMonth6_Percent As Decimal
Public WorksheetSalesPlanNumber As Integer
Public ProjectCtdUnitQuantity As Integer
Public StartRegularOnHandQuantity As Integer
Public StartClearanceOnHandQuantity As Integer
Public StartFinalOnHandQuantity As Integer
Public LastModifiedTimeStamp As DateTime
Public LastModifedID As String
Public ClusterInfo() As ClusterData
End Structure
In this example, I want to create many FixtureFillSeason instances and put them into the parent structure - then send the parent structure back to the web service.
Public Sub SaveFixtureFill()
'Save all of the fixture fill data
Dim FFObj As New struct_FixtureFillData
FFObj.LadderID = "12453"
FFObj.YearNumber = "2010"
'Set up the three seasons
Dim FFSeason1 As New struct_FixtureFillSeason
FFSeason1.FixtureFillMonth1_Percent = Range("H9")
FFSeason1.FixtureFillMonth2_Percent = Range("H10")
FFSeason1.FixtureFillMonth3_Percent = Range("H11")
FFSeason1.FixtureFillMonth4_Percent = Range("H12")
FFSeason1.FixtureFillMonth5_Percent = Range("H13")
FFSeason1.FixtureFillMonth6_Percent = Range("H14")
FFSeason1.LastModifedID = "LDDRUSR"
FFSeason1.LastModifiedTimeStamp = DateTime.Now
FFSeason1.LYDoorCtr = 45
FFSeason1.ProjectCtdUnitQuantity = 46
FFSeason1.SeasonChar = "1"
FFSeason1.StartClearanceOnHandQuantity = 2353
FFSeason1.StartFinalOnHandQuantity = 3882
FFSeason1.StartRegularOnHandQuantity = 3885
FFSeason1.WorksheetSalesPlanNumber = 3
FFObj.FixtureFillSeasons(0) = FFSeason1
Dim FIXFILLWS As New clsws_WSLadderPlan
FIXFILLWS.wsm_UpdateFixtureFillData (FFObj)
End Sub
I realize there is some initialization needed - but you hopefully this provides enough data to understand what I am trying to do.