private static void SaveFile() { var root = new XElement("DevisIds"); foreach (var devisId in DevisIds) { root.Add(DevisIdType.ToXElement(devisId)); } File.WriteAllText(Path, new XDocument(root).ToString()); }
public static int Add(DevisIdType di) { DevisIds.Add(di); var document = XDocument.Load(Path); document.GetXElement("DevisIds").Add(DevisIdType.ToXElement(di)); File.WriteAllText(Path, document.ToString()); if (SyncData.IsConnect) { using (var connection = ConnectionFactory.CreateConnection()) return(connection.Execute(InsertQuery, di)); } return(0); }