Advertisement
GeneralGDA

Writing XML

Jun 26th, 2014
576
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.21 KB | None | 0 0
  1. public void WriteCostEstablishmentReport(FileInfo destination, EvaluationReport report)
  2. {
  3.     if (null == report)
  4.     {
  5.         throw new ArgumentNullException("report");
  6.     }
  7.  
  8.     if (null == destination)
  9.     {
  10.         throw new ArgumentNullException("destination");
  11.     }
  12.  
  13.     var tree =
  14.         new XElement("FD_State_Cadastral_Valuation", MakeDataFundSchemaVersionAttribute(),
  15.             GenerateReportHeader(report),
  16.             new XElement("Package",
  17.                 GenerateGroupsList(report),
  18.                 new XElement("Evaluative_Factors", GenerateEvaluativeFactors(report)),
  19.                 new XElement("Appraise",
  20.                     new XElement("Valuation",
  21.                         from estates in report.CostEstablishment select new XElement("Group_Real_Estate_Valuation",
  22.                             new XElement("Rationale", report.DivisionGroups[estates.Key].Rationale),
  23.                                 new XElement("Real_Estates",
  24.                                     from realEstate in estates select
  25.                                         GenerateEvaluatedRealEstate(realEstate.RealEstate, realEstate.GroupId))  )))));
  26.  
  27.             tree.Save(destination.ToString(), SaveOptions.None);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement