/// <summary> /// Pulls an XmlNode from the LineItem /// </summary> public String ToXml() { return("<LineItem>\n" + " <Date>" + this.m_Date.ToShortDateString() + "</Date>\n" + " <Amount>" + this.m_Amount.ToString() + "</Amount>\n" + " <UnitPeriods>" + this.m_Span.Periods.ToString() + "</UnitPeriods>\n" + " <OddDays>" + this.m_Span.OddDays.ToString() + "</OddDays>\n" + " <NumberOccurrences>" + this.m_Occurences.ToString() + "</NumberOccurrences>\n" + " <Recurrence>" + DateTimeCalculations.GetUnitPeriodString(this.m_Recurrence) + "</Recurrence>\n" + " <PVIF>" + this.m_PVIF.ToString() + "</PVIF>\n" + " <PresentValue>" + this.m_PresentValue.ToString() + "</PVIF>\n" + " <Balance>" + this.m_Balance.ToString() + "</Balance>\n" + "</LineItem>"); }
public String ToXml() { System.Text.StringBuilder sb = new StringBuilder(); sb.AppendLine("<LineItems>"); sb.AppendLine(" <APR>" + this.m_APR.ToString() + "</APR>"); sb.AppendLine(" <CommonPeriod>" + DateTimeCalculations.GetUnitPeriodString(this.m_CommonPeriod) + "</CommonPeriod>"); sb.AppendLine(" <PeriodsPerYear>" + this.m_PeriodsPerYear.ToString() + "</PeriodsPerYear>"); sb.AppendLine(" <DaysPerPeriod>" + this.m_DaysPerPeriod.ToString() + "</DaysPerPeriod>"); sb.AppendLine(" <StartDate>" + this.m_StartDate.ToShortDateString() + "</StartDate>"); sb.AppendLine(" <FinalBalance>" + this.m_FinalBalance.ToString() + "</FinalBalance>"); for (int i = 0; i < this.m_Items.Count; i++) { LineItem li = (LineItem)this.m_Items[i]; sb.Append(li.ToXml()); } sb.AppendLine("</LineItems>"); return(sb.ToString()); }