16,549
社区成员
发帖
与我相关
我的任务
分享
Private Class TOrder
Dim _fdate As DateTime
Dim _custID As Integer
Dim _salerID As Integer
Public Property FDate As DateTime
Get
Return _fdate
End Get
Set(value As DateTime)
_fdate = value
End Set
End Property
Public Property CustID As Integer
Get
Return _custID
End Get
Set(value As Integer)
_custID = value
End Set
End Property
Public Property SalerID As Integer
Get
Return _salerID
End Get
Set(value As Integer)
_salerID = value
End Set
End Property
Property Entries As New List(Of TEntry)
End Class
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
Dim o As TOrder = New TOrder
Dim en As TEntry = New TEntry
With o
.FDate = #8/31/2016#
.CustID = 10985
.SalerID = 60338
With en
.Index = 1
.EntryID = 109
.ItemID = 277
.Price = 65
.Qty = 10
.Amount = .Price * .Qty
.Note = "分录1,玉米"
End With
.Entries.Add(en)
With en
.Index = 2
.EntryID = 110
.ItemID = 295
.Price = 55
.Qty = 10
.Amount = .Price * .Qty
.Note = "分录2,大豆"
End With
.Entries.Add(en)
End With
Dim jString As String = JsonConvert.SerializeObject(o, Formatting.Indented)
RichTextBox1.AppendText(jString)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
{
"FDate": "\/Date(1472572800000+0800)\/",
"CustID": 10985,
"SalerID": 60338,
"Entries": [
{
"Index": 2,
"EntryID": 110,
"ItemID": 295,
"Qty": 10.0,
"Price": 55.0,
"Amount": 550.0,
"Note": "分录2,大豆"
},
{
"Index": 2,
"EntryID": 110,
"ItemID": 295,
"Qty": 10.0,
"Price": 55.0,
"Amount": 550.0,
"Note": "分录2,大豆"
}
]
}