protected static void Read(XmlReader reader, BankTransList aTransList) { string lastName = String.Empty; while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { lastName = reader.Name; if (lastName == "STMTTRN") { STMTTRN tran = new STMTTRN(); aTransList.Trans.Add(tran); Read(reader, tran); } } if (reader.NodeType == XmlNodeType.Text) { try { if (lastName == "DTSTART") { string value = reader.Value.Trim(); aTransList.DTSTART = ParseDateTime(value); } if (lastName == "DTEND") { string value = reader.Value.Trim(); aTransList.DTEND = ParseDateTime(value); } } catch (FormatException ex) { throw new PXException(Messages.OFXParsingErrorValueHasInvalidFormat, lastName, ex.Message); } } if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "BANKTRANLIST") { return; } } }
protected static void Read(XmlReader reader, BankTransList aTransList) { string lastName = String.Empty; while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element) { lastName = reader.Name; if (lastName == "STMTTRN") { STMTTRN tran = new STMTTRN(); aTransList.Trans.Add(tran); Read(reader, tran); } } if (reader.NodeType == XmlNodeType.Text) { try { if (lastName == "DTSTART") { string value = reader.Value.Trim(); aTransList.DTSTART = ParseDateTime(value); } if (lastName == "DTEND") { string value = reader.Value.Trim(); aTransList.DTEND = ParseDateTime(value); } } catch (FormatException ex) { throw new PXException(Messages.OFXParsingErrorValueHasInvalidFormat, lastName, ex.Message); } } if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "BANKTRANLIST") { return; } } }