private static artikelInformatieArtikel CreateNewArtikelInformatieArtikel(ProductInformation product) { var artInfo = new artikelInformatieArtikel { artikelNummer = product.Artikelnummer, kleurNummer = product.Kleurnummer, startDatum = product.Startdatum, korteOmschrijving = product.Korteomschrijving.Length > 16 ? product.Korteomschrijving.Substring(0, 16) : product.Korteomschrijving, langeOmschrijving = product.Langeomschrijving, kleurOmschrijving = product.Kleuromschrijving.Length > 100 ? product.Kleuromschrijving.Substring(0, 100) : product.Kleuromschrijving, kwaliteitOmschrijving = product.Kwaliteitomschrijving.Length > 100 ? product.Kwaliteitomschrijving.Substring(0, 100) : product.Kwaliteitomschrijving, materiaalOmschrijving = product.MateriaalomschrijvingCoolcat.Length > 100 ? product.MateriaalomschrijvingCoolcat.Substring(0, 100) : product.MateriaalomschrijvingCoolcat, beeldSoortNummer = "4", artikelGroep = product.Artikelgroep, maatlijst = new List <artikelInformatieArtikelMaatGegevens>() }; if (artInfo.langeOmschrijving.IndexOf("\r", StringComparison.Ordinal) > 0) { artInfo.langeOmschrijving = artInfo.langeOmschrijving.Substring(0, artInfo.langeOmschrijving.IndexOf("\r", StringComparison.Ordinal)); } if (artInfo.langeOmschrijving.IndexOf("\n", StringComparison.Ordinal) > 0) { artInfo.langeOmschrijving = artInfo.langeOmschrijving.Substring(0, artInfo.langeOmschrijving.IndexOf("\n", StringComparison.Ordinal)); } artInfo.langeOmschrijving = artInfo.langeOmschrijving.Length > 3000 ? artInfo.langeOmschrijving.Substring(0, 3000) : artInfo.langeOmschrijving; return(artInfo); }
/// <summary> /// Deserializes xml markup from file into an artikelInformatieArtikel object /// </summary> /// <param name="fileName">string xml file to load and deserialize</param> /// <param name="obj">Output artikelInformatieArtikel 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 artikelInformatieArtikel obj, out System.Exception exception) { exception = null; obj = default(artikelInformatieArtikel); try { obj = LoadFromFile(fileName); return(true); } catch (System.Exception ex) { exception = ex; return(false); } }
/// <summary> /// Deserializes workflow markup into an artikelInformatieArtikel object /// </summary> /// <param name="xml">string workflow markup to deserialize</param> /// <param name="obj">Output artikelInformatieArtikel 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 artikelInformatieArtikel obj, out System.Exception exception) { exception = null; obj = default(artikelInformatieArtikel); try { obj = Deserialize(xml); return(true); } catch (System.Exception ex) { exception = ex; return(false); } }
public static bool LoadFromFile(string fileName, out artikelInformatieArtikel obj) { System.Exception exception = null; return(LoadFromFile(fileName, out obj, out exception)); }
public static bool Deserialize(string xml, out artikelInformatieArtikel obj) { System.Exception exception = null; return(Deserialize(xml, out obj, out exception)); }