private void AppendRecords(Dictionary <string, StatementEntry> entries, XmlDocument xml) { foreach (KeyValuePair <String, StatementEntry> pair in entries) { StatementEntry entry = pair.Value; XmlElement node = xml.CreateElement("op1"); xml.DocumentElement.AppendChild(node); node.SetAttribute("tip", entry.Type.ToString()); node.SetAttribute("cuiP", entry.PartenerCUI); node.SetAttribute("denP", entry.PartenerName); node.SetAttribute("nrFact", entry.InvoiceCount.ToString()); node.SetAttribute("baza", entry.BaseValue.ToString()); node.SetAttribute("tva", entry.VATValue.ToString()); } }
public Dictionary<String, StatementEntry> ReadEntries() { Dictionary<String, StatementEntry> result = new Dictionary<String, StatementEntry>(); XmlNodeList entries = doc.SelectNodes("//ds:op1", nsmgr); foreach (XmlNode entry in entries) { string type = entry.Attributes["tip"].Value; string partenerCUI = entry.Attributes["cuiP"].Value; string partenerName = entry.Attributes["denP"].Value; int invoiceCount = Convert.ToInt32(entry.Attributes["nrFact"].Value); int baseValue = Convert.ToInt32(entry.Attributes["baza"].Value); int vatValue = Convert.ToInt32(entry.Attributes["tva"].Value); StatementEntry e = new StatementEntry(type, partenerCUI, partenerName, invoiceCount, baseValue, vatValue); result.Add(e.Type + e.PartenerCUI, e); } return result; }
public Dictionary <String, StatementEntry> ReadEntries() { Dictionary <String, StatementEntry> result = new Dictionary <String, StatementEntry>(); XmlNodeList entries = doc.SelectNodes("//ds:op1", nsmgr); foreach (XmlNode entry in entries) { string type = entry.Attributes["tip"].Value; string partenerCUI = entry.Attributes["cuiP"].Value; string partenerName = entry.Attributes["denP"].Value; int invoiceCount = Convert.ToInt32(entry.Attributes["nrFact"].Value); int baseValue = Convert.ToInt32(entry.Attributes["baza"].Value); int vatValue = Convert.ToInt32(entry.Attributes["tva"].Value); StatementEntry e = new StatementEntry(type, partenerCUI, partenerName, invoiceCount, baseValue, vatValue); result.Add(e.Type + e.PartenerCUI, e); } return(result); }