예제 #1
0
        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);
        }
예제 #2
0
        /// <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());
        }
예제 #3
0
        /// <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());
        }
예제 #4
0
 /// <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)
 {
 }
예제 #5
0
 /// <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")
 {
 }
예제 #6
0
 public PatientImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component)
 {
 }
예제 #7
0
 /// <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")
 {
 }
예제 #8
0
 /// <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")
 {
 }
예제 #9
0
 /// <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)
 {
 }
예제 #10
0
 public TagImporter(SQLiteConnection connection, IImportComponent component, TagCategory category, string table)
     : base(connection, component, category.ToString())
 {
     this.Table    = table;
     this.Category = category;
 }
예제 #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SingleImporter&lt;T&gt;"/> 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;
 }
예제 #12
0
 /// <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)
 {
 }
예제 #13
0
 /// <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)
 {
 }
예제 #14
0
 public BaseImporter(SQLiteConnection connection, IImportComponent component)
 {
     this.Logger     = LogManager.GetLogger(this.GetType());
     this.Connection = connection;
     this.Component  = component;
 }
예제 #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SingleImporter&lt;T&gt;"/> class.
 /// </summary>
 /// <param name="connection">The connection.</param>
 /// <param name="component">The component.</param>
 public MultipleImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component)
 {
 }
예제 #16
0
 /// <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)
 {
 }
예제 #17
0
        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;
        }
예제 #18
0
 /// <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")
 {
 }
예제 #19
0
 /// <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)
 {
 }
예제 #20
0
 public PatientImporter(SQLiteConnection connection, IImportComponent component)
     : base(connection, component)
 {
 }