private void btnImport_Click(object sender, EventArgs e) { this.btnOK.Enabled = false; this.btnCancel.Enabled = false; if (StaticWindows.Requester( "Wollen Sie wirklich Ihre Microsoft SQL Server Datenbank in die SQLite Datenbank migrieren?" ) == System.Windows.Forms.DialogResult.Yes) { this.lblState.Text = "Migration gestartet, lade Daten..."; this.btnCancel.Enabled = true; this._importer = new SQLServerToSQLiteImporter(); this._importer.PercentState += new ImportPercentEventHandler(_importer_PercentState); if (this._importer.Import()) { StaticWindows.InfoBox("Erfolgreich migriert!"); } else { StaticWindows.ErrorBox("Während der Migration ist ein Fehler aufgetreten!"); } } else { this.lblState.Text = "Migration abgebrochen!"; this.btnOK.Enabled = true; this.btnCancel.Enabled = true; } }
// --------------------------------------------------- // CONSTRUCTORS // --------------------------------------------------- /// <summary> /// Default Ctor /// </summary> public DatabaseBackupForm() { InitializeComponent(); this._brh = new BackupRestoreHandler(Configuration.ConnectionString); this.DialogResult = DialogResult.Cancel; this._brh.BackupPercentEvent += new BackupRestoreHandler.BackupPercentEventHandler(_brh_BackupPercentEvent); this._brh.BackupCompleteEvent += new BackupRestoreHandler.BackupCompleteEventHandler(_brh_BackupCompleteEvent); this.pbProgress.Minimum = 0; this.pbProgress.Maximum = 100; this.fbDialog.RootFolder = Environment.SpecialFolder.MyComputer; try { this.gbBackup.Text = "Letztes Backup am: " + this._brh.GetLastBackupDate().ToString(); this.txtPath.Text = Configuration.CommonApplicationTempPath; } catch (Exception ex) { StringBuilder str = new StringBuilder(); str.Append("Die Backupschnittstelle konnte nicht initialisiert werden."); str.Append(" Eventuell sind nicht alle notwendigen Komponenten installiert."); str.Append("\n\n"); str.Append("Fehlermeldung: "); str.Append(ex.Message); StaticWindows.ErrorBox(str.ToString()); } }
/// <summary> /// Handles the Click event of the btnOpenEditor control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void btnOpenEditor_Click(object sender, EventArgs e) { if (this.txtResponse.Text.Length > 0) { WikipediaParser parser = new WikipediaParser( Configuration.ConnectionString ); Movie mov = parser.Parse(this.txtResponse.Text); // search for movie with title like mov.Title if (mov != null) { MovieForm form = new MovieForm(mov); if (form.ShowDialog(this) == DialogResult.OK) { // alles schliessen this.DialogResult = DialogResult.OK; this.Close(); this.DialogResult = DialogResult.OK; } } else { StaticWindows.ErrorBox("Fehler: Es konnte kein Film geparst werden!"); } } else { StaticWindows.ErrorBox("Fehler: Es ist kein Wikipedia Artikel ausgewählt!"); } }
/// <summary> /// _export_s the excel export finish. /// </summary> /// <param name="successfull">if set to <c>true</c> [successfull].</param> /// <param name="text">The text.</param> void _export_ExcelExportFinish(bool successfull, string text) { this.btnOK.Enabled = true; this.btnCancel.Enabled = true; this.txtFilename.Enabled = true; this.txtTargetPath.Enabled = true; this.txtSheettitle.Enabled = true; this.cbExport.Enabled = true; foreach (CheckBox chk in this.colsPanel.Controls) { chk.Enabled = true; } if (this._filename.Trim() != "" && successfull) { this.pbState.Value = this.pbState.Maximum; this.lblState.Text = text; this.lblState.Refresh(); this.lblState.Update(); try { AppLoader loader = new AppLoader(); loader.LoadApp(this._filename); } catch (Exception ex) { StaticWindows.ErrorBox(ex.Message); } this.pbState.Value = 0; this.lblState.Text = ""; this.lblState.Refresh(); this.lblState.Update(); } else { StaticWindows.ErrorBox("Es trat ein unbekannter Fehler während des Exports auf!"); } this.pbState.Maximum = this._movies.Count; foreach (CheckBox chk in this.colsPanel.Controls) { this.pbState.Maximum += 1; } }
static void Main() { bool __startOldApp = false; int __windowsVersion = Environment.OSVersion.Version.Major; if (__windowsVersion < 6) { StaticWindows.InfoBox( "MovieMatic2: Windows Vista Not Found", "This program requires Windows Vista or later to run," + "\nbut for compatibility reason we start the old version." ); __startOldApp = true; } if (__startOldApp) { string mmPath = Application.ResourceAssembly.Location; mmPath = mmPath.Replace(Application.ResourceAssembly.ManifestModule.Name, "MovieMatic.exe"); if (File.Exists(mmPath)) { AppLoader loader = new AppLoader(); loader.LoadApp(mmPath); } else { StaticWindows.ErrorBox( "MovieMatic2: MovieMatic version 1.x not found", "MovieMatic version 1.x cannot start then the program was not found." ); } } else { App.Main(); } }