public byte[] Export(IEnumerable <ClaimRUTROTProcess.DocumentDetails> documents) { using (var stream = new MemoryStream()) { using (Writer = XmlWriter.Create(stream, new XmlWriterSettings { Indent = true })) { WriteRoot(); var claims = RUTExportItem.Create(documents); WriteClaimsStart(documents.First().ClaimNbr.ToString()); foreach (var c in claims) { WritePersonClaim(c); } WriteEnd(); Writer.Flush(); return(stream.ToArray()); } } }
protected override void WriteSpecialPersonClaimInfo(RUTExportItem item) { if (IsForProperty(item.RutRotInvoice)) { WriteHtko(PropertyID, item.RutRotInvoice.ROTEstateAppartment); } else { WriteHtko(ApartmentID, item.RutRotInvoice.ROTEstateAppartment); WriteHtko(OrganizationNbr, OrgNbrPrefix + item.RutRotInvoice.ROTOrganizationNbr); } }
protected void WritePersonClaim(RUTExportItem item) { WriteStartHtko(Claim); WriteHtko(Buyer, item.PersonID); WriteHtko(PayDate, item.PayDate.ToString("yyyy-MM-dd")); WriteHtko(InvoiceAmt, AmountString(item.TotalAmtForWork)); WriteHtko(PaidAmt, AmountString(item.PaidAmt)); WriteHtko(ClaimedAmt, AmountString(item.ClaimedAmt)); if (!String.IsNullOrWhiteSpace(item.InvoiceNbr)) { WriteHtko(InvoiceNbr, item.InvoiceNbr); } WriteSpecialPersonClaimInfo(item); Writer.WriteEndElement(); }
protected virtual void WriteSpecialPersonClaimInfo(RUTExportItem item) { }