public bool Import(IImportComponent component) { var connection = new SQLiteConnection(string.Format("Data Source={0};Version=3;", this.path)); IEnumerable <PatientDto> result = new List <PatientDto>(); try { this.OnLogged(Messages.Log_StartImporting); var patients = new PatientImporter(connection, component); patients.Logged += (sender, e) => this.OnLogged(e.Data); patients.ProgressChanged += (sender, e) => this.OnProgressChanged(e.Data); patients.Import(); this.OnLogged(Messages.Log_EndImporting); this.OnProgressChanged(100); } catch (Exception ex) { this.HandleError(ex); } finally { if (connection.State != ConnectionState.Closed) { connection.Close(); } } return(this.hasError); }
/// <summary> /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class. /// </summary> public WorkbenchViewModel() { this.component = PluginContext.ComponentFactory.GetInstance <IImportComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IImportComponent>(); this.ChooseOldDbCommand = new RelayCommand(() => this.ChooseOldDb()); this.ImportCommand = new RelayCommand(() => this.Import(), () => this.CanImport()); }
/// <summary> /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class. /// </summary> public WorkbenchViewModel() { this.component = PluginContext.ComponentFactory.GetInstance<IImportComponent>(); PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance<IImportComponent>(); this.ChooseOldDbCommand = new RelayCommand(() => this.ChooseOldDb()); this.ImportCommand = new RelayCommand(() => this.Import(), () => this.CanImport()); }
/// <summary> /// Initializes a new instance of the <see cref="DoctorImporter"/> class. /// </summary> /// <param name="connection">The connection.</param> /// <param name="component">The component.</param> public IllnessPeriodImporter(SQLiteConnection connection, IImportComponent component) : base(connection, component) { }
/// <summary> /// Initializes a new instance of the <see cref="InsuranceImporter"/> class. /// </summary> /// <param name="connection">The connection.</param> /// <param name="component">The component.</param> public InsuranceImporter(SQLiteConnection connection, IImportComponent component) : base(connection, component, "Insurance") { }
public PatientImporter(SQLiteConnection connection, IImportComponent component) : base(connection, component) { }
/// <summary> /// Initializes a new instance of the <see cref="ReputationImporter"/> class. /// </summary> /// <param name="connection">The connection.</param> public ReputationImporter(SQLiteConnection connection, IImportComponent component) : base(connection, component, "Reputation") { }
/// <summary> /// Initializes a new instance of the <see cref="ReputationImporter"/> class. /// </summary> /// <param name="connection">The connection.</param> public PracticeImporter(SQLiteConnection connection, IImportComponent component) : base(connection, component, "Practice") { }
/// <summary> /// Initializes a new instance of the <see cref="DoctorImporter"/> class. /// </summary> /// <param name="connection">The connection.</param> /// <param name="component">The component.</param> public MedicalRecordImporter(SQLiteConnection connection, IImportComponent component) : base(connection, component) { }
public TagImporter(SQLiteConnection connection, IImportComponent component, TagCategory category, string table) : base(connection, component, category.ToString()) { this.Table = table; this.Category = category; }
/// <summary> /// Initializes a new instance of the <see cref="SingleImporter<T>"/> class. /// </summary> /// <param name="connection">The connection.</param> /// <param name="component">The component.</param> public SingleImporter(SQLiteConnection connection, IImportComponent component, string segragator) : base(connection, component) { this.Default = default(T); this.Segragator = segragator; }
/// <summary> /// Initializes a new instance of the <see cref="DoctorImporter"/> class. /// </summary> /// <param name="connection">The connection.</param> /// <param name="component">The component.</param> public DoctorImporter(SQLiteConnection connection, IImportComponent component) : base(connection, component) { }
/// <summary> /// Initializes a new instance of the <see cref="DoctorImporter"/> class. /// </summary> /// <param name="connection">The connection.</param> /// <param name="component">The component.</param> public PictureImporter(SQLiteConnection connection, IImportComponent component) : base(connection, component) { }
public BaseImporter(SQLiteConnection connection, IImportComponent component) { this.Logger = LogManager.GetLogger(this.GetType()); this.Connection = connection; this.Component = component; }
/// <summary> /// Initializes a new instance of the <see cref="SingleImporter<T>"/> class. /// </summary> /// <param name="connection">The connection.</param> /// <param name="component">The component.</param> public MultipleImporter(SQLiteConnection connection, IImportComponent component) : base(connection, component) { }
/// <summary> /// Initializes a new instance of the <see cref="DoctorImporter"/> class. /// </summary> /// <param name="connection">The connection.</param> /// <param name="component">The component.</param> public PrescriptionImporter(SQLiteConnection connection, IImportComponent component) : base(connection, component) { }
public bool Import(IImportComponent component) { var connection = new SQLiteConnection(string.Format("Data Source={0};Version=3;", this.path)); IEnumerable<PatientDto> result = new List<PatientDto>(); try { this.OnLogged(Messages.Log_StartImporting); var patients = new PatientImporter(connection, component); patients.Logged += (sender, e) => this.OnLogged(e.Data); patients.ProgressChanged += (sender, e) => this.OnProgressChanged(e.Data); patients.Import(); this.OnLogged(Messages.Log_EndImporting); this.OnProgressChanged(100); } catch (Exception ex) { this.HandleError(ex); } finally { if (connection.State != ConnectionState.Closed) connection.Close(); } return this.hasError; }
/// <summary> /// Initializes a new instance of the <see cref="ReputationImporter"/> class. /// </summary> /// <param name="connection">The connection.</param> public PathologyImporter(SQLiteConnection connection, IImportComponent component) : base(connection, component, "Pathology") { }
/// <summary> /// Initializes a new instance of the <see cref="DoctorImporter"/> class. /// </summary> /// <param name="connection">The connection.</param> /// <param name="component">The component.</param> public AppointmentImporter(SQLiteConnection connection, IImportComponent component) : base(connection, component) { }
public PatientImporter(SQLiteConnection connection, IImportComponent component) : base(connection, component) { }