Exemplo n.º 1
0
 public static XmlFile WithVeranstaltungen(this XmlFile xmlFile, Veranstaltung veranstaltung)
 {
     xmlFile.WithLine("  <Veranstaltung ")
     .WithContent("    Name='").WithContent(veranstaltung.Name).WithLine("'")
     .WithContent("    BeginntAm='").WithContent(veranstaltung.BeginntAm.ToString(VeranstaltungsDto.DateFormat)).WithLine("'")
     .WithContent("    EndetAm='").WithContent(veranstaltung.EndetAm.ToString(VeranstaltungsDto.DateFormat)).WithLine("'>")
     .WithLine("      <Aufgaben>");
     foreach (var aufgabe in veranstaltung.Aufgaben)
     {
         xmlFile.WithAufgabe(aufgabe);
     }
     xmlFile.WithLine("      </Aufgaben>")
     .WithLine("    </Veranstaltung>");
     return(xmlFile);
 }
Exemplo n.º 2
0
 public static XmlFile WithPerson(this XmlFile xmlFile, Person person)
 {
     xmlFile.WithLine("  <Person ")
         .WithContent("    Name='").WithContent(person.Name).WithLine("'")
         .WithContent("    Vorname='").WithContent(person.Vorname).WithLine("'")
         .WithContent("    BerufName='").WithContent(person.Beruf.Name).WithLine("'")
         .WithContent("    MinutenSatz='").WithContent(person.MinutenSatz.ToString(CultureInfo.InvariantCulture)).WithLine("'>");
     var rollen = person.EinsetzbarAls.ToList();
     if (rollen.Any())
     {
         xmlFile.WithLine("    <EinsetzbarAls>");
         foreach(var rolle in rollen)
             xmlFile.WithContent("      <Rolle Name='").WithContent(rolle.Name).WithLine("' />");
         xmlFile.WithLine("    </EinsetzbarAls>");
     }
     xmlFile.WithLine("  </Person>");
     return xmlFile;
 }