Exemplo n.º 1
0
 /// <summary>
 /// Deserializes xml markup from file into an artikelEigenschapArtikel object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output artikelEigenschapArtikel object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out artikelEigenschapArtikel obj, out System.Exception exception)
 {
     exception = null;
     obj       = default(artikelEigenschapArtikel);
     try
     {
         obj = LoadFromFile(fileName);
         return(true);
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return(false);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Deserializes workflow markup into an artikelEigenschapArtikel object
 /// </summary>
 /// <param name="xml">string workflow markup to deserialize</param>
 /// <param name="obj">Output artikelEigenschapArtikel object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string xml, out artikelEigenschapArtikel obj, out System.Exception exception)
 {
     exception = null;
     obj       = default(artikelEigenschapArtikel);
     try
     {
         obj = Deserialize(xml);
         return(true);
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return(false);
     }
 }
        private static artikelEigenschap CreateProductAttributes(List <ProductInformation> products)
        {
            var eigenschap = new artikelEigenschap();

            foreach (var information in products)
            {
                var artEigenschap = new artikelEigenschapArtikel
                {
                    artikelNummer   = information.Artikelnummer,
                    kleurNummer     = information.Kleurnummer,
                    eigenschaplijst = new List <artikelEigenschapArtikelEigenschapGegevens>()
                };

                artEigenschap.eigenschaplijst.Add(new artikelEigenschapArtikelEigenschapGegevens
                {
                    eigenschap       = "Geslacht",
                    eigenschapWaarde = VendorItemHelper.GetWehkampGender(information.VendorItemNumber, information.VendorID)
                });

                artEigenschap.eigenschaplijst.Add(new artikelEigenschapArtikelEigenschapGegevens
                {
                    eigenschap       = "Kleur",
                    eigenschapWaarde = information.WehkampKleuromschrijving
                });

                artEigenschap.eigenschaplijst.Add(new artikelEigenschapArtikelEigenschapGegevens
                {
                    eigenschap       = "Materiaal",
                    eigenschapWaarde = information.MateriaalomschrijvingWehkamp
                });

                artEigenschap.eigenschaplijst.Add(new artikelEigenschapArtikelEigenschapGegevens
                {
                    eigenschap       = "Merk",
                    eigenschapWaarde = VendorSettingsHelper.GetMerkName(information.VendorID)
                });

                var wehkampSleeveLength = VendorItemHelper.GetWehkampSleeveLength(information.VendorItemNumber, information.VendorID);
                if (!string.IsNullOrEmpty(wehkampSleeveLength))
                {
                    artEigenschap.eigenschaplijst.Add(new artikelEigenschapArtikelEigenschapGegevens
                    {
                        eigenschap       = "Mouwlengte",
                        eigenschapWaarde = wehkampSleeveLength
                    });
                }

                if (information.VendorID == 25)
                {
                    if (!string.IsNullOrEmpty(information.Dessin))
                    {
                        artEigenschap.eigenschaplijst.Add(new artikelEigenschapArtikelEigenschapGegevens
                        {
                            eigenschap       = "Dessin",
                            eigenschapWaarde = information.Dessin
                        });
                    }

                    if (!string.IsNullOrEmpty(information.Kraagvorm))
                    {
                        artEigenschap.eigenschaplijst.Add(new artikelEigenschapArtikelEigenschapGegevens
                        {
                            eigenschap       = "Kraagvorm",
                            eigenschapWaarde = information.Kraagvorm
                        });
                    }

                    if (!string.IsNullOrEmpty(information.Pijpwijdte))
                    {
                        artEigenschap.eigenschaplijst.Add(new artikelEigenschapArtikelEigenschapGegevens
                        {
                            eigenschap       = "Pijpwijdte",
                            eigenschapWaarde = information.Pijpwijdte
                        });
                    }
                }


                eigenschap.artikel.Add(artEigenschap);
            }
            return(eigenschap);
        }
Exemplo n.º 4
0
 public static bool LoadFromFile(string fileName, out artikelEigenschapArtikel obj)
 {
     System.Exception exception = null;
     return(LoadFromFile(fileName, out obj, out exception));
 }
Exemplo n.º 5
0
 public static bool Deserialize(string xml, out artikelEigenschapArtikel obj)
 {
     System.Exception exception = null;
     return(Deserialize(xml, out obj, out exception));
 }