Ahoj,
mam takovy blby dotaz, ale asi jsem uz unaveny nebo co, kdyz si serializuju a ulozim tuhle tridu, tak mam v Karty vnorenou 2x Karta, potrebuju ji jen jednou, tedy seznam Karta v Karty
dekuji za nakopnuti
Partial Class ImportStock
Inherits System.Web.UI.Page
Private Sub form1_Load(sender As Object, e As EventArgs) Handles form1.Load
Dim Karty As New OlSyClass.Karty
Dim Karta As New OlSyClass.Karta
Dim Vlastnosti As New OlSyClass.Vlastnosti
Vlastnosti.EAN = "1"
Vlastnosti.EANBal = "2"
Karta.Nazov = "Produkt"
Karta.Popis = "popis produktu"
Karta.CenaPredaj = "1"
Karta.MJ = "ks"
Karta.NazovPLU = "produkt"
Karta.Vlastnosti = Vlastnosti
Karty.Karta.Add(Karta)
Karty.Karta.Add(Karta)
Dim SerializerMakesList As New System.Xml.Serialization.XmlSerializer(GetType(OlSyClass.Karty))
Dim SWMakesList As IO.StreamWriter = New IO.StreamWriter(HttpContext.Current.Server.MapPath("\App_Data\OlSyStockInit.xml"))
SerializerMakesList.Serialize(SWMakesList, Karty)
SWMakesList.Close()
End Sub
Public Class OlSyClass
Class Karty
Property Karta As New List(Of Karta)
End Class
Class Karta
Property Nazov As String
Property Popis As String
Property CenaPredaj As String
Property MJ As String
Property NazovPLU As String
Property Vlastnosti As New Vlastnosti
End Class
Class Vlastnosti
Property EAN As String
Property EANBal As String
End Class
End Class
End Class