public void ChangeInfoContract(BE.Contract c) //A function that gets Contract after its details have been updated //The function finds the Contract in the database in the xml file before the update, //deletes it from the list and adds the Contract after the update { XElement root = BasicXML.LoadData(); XElement help; help = (from item in root.Elements() where item.Name == "Contract" where int.Parse(item.Element("NumberOfContract").Value) == c.NumberOfContract select item).FirstOrDefault(); help.Remove(); root.Add(ExtensionBE.ToXML(c)); BasicXML.Save(root); }