/// <summary> /// Updates the database using the specified xml, which is deserialize into a <see cref="PatientFile"/> instance, first. /// </summary> /// <param name="xml">The xml representing a <see cref="PatientFile"/> object.</param> public void Update(string xml) { ConsoleD.WriteLine("Updating database using xml"); lock (globalSync) { this.UpdateInProgress = true; this.UpdateStarted(null, EventArgs.Empty); var finishedEventArgs = new UpdateFinishedEventArgs(UpdateType.SeedData, false); var patientFile = new PatientFileParser().Deserialize(xml); if (patientFile != null) { if (this.SaveToDatabase(patientFile)) { finishedEventArgs.Success = true; } } this.UpdateFinished(null, finishedEventArgs); this.UpdateInProgress = false; } }
/// <summary> /// Updates the database using the specified xml, which is deserialize into a <see cref="PatientFile"/> instance, first. /// </summary> /// <param name="xml">The xml representing a <see cref="PatientFile"/> object.</param> public void Update(string xml) { ConsoleD.WriteLine ("Updating database using xml"); lock (globalSync) { this.UpdateInProgress = true; this.UpdateStarted(null, EventArgs.Empty); var finishedEventArgs = new UpdateFinishedEventArgs(UpdateType.SeedData, false); var patientFile = new PatientFileParser().Deserialize(xml); if (patientFile != null) { if (this.SaveToDatabase(patientFile)) { finishedEventArgs.Success = true; } } this.UpdateFinished(null, finishedEventArgs); this.UpdateInProgress = false; } }