예제 #1
0
 private void button4_Click(object sender, EventArgs e)
 {
     // получение списка мостов
     //List<BridgeData> list = new BridgesReader(true).Load();
     // старт экспорта
     Coordinator coordinator = new Coordinator();
     // setup actions
     coordinator.AddAction(new ActionDeploy(true));
     coordinator.AddAction(new ActionViewLog(new dlgLog()));
     coordinator.AddAction(new ActionViewSessions(new dlgSessions()));
     coordinator.AddAction(new ActionToggleUsersOff());
     coordinator.AddAction(new ActionSwitchTriggers(false, "Выключение триггеров"));
     coordinator.AddAction(new ActionClearOracleBr());
     coordinator.AddAction(new ActionPDAToOracleTransfer());
     coordinator.AddAction(new ActionSwitchTriggers(true, "Включение триггеров"));
     coordinator.AddAction(new ActionFinishImportScripts());
     coordinator.AddAction(new ActionSetBrReadOnly(null, false));
     coordinator.AddAction(new ActionDoFinally());
     // make dialog
     dlgRunning dlg = new dlgRunning();
     dlg.Text = "Импорт";
     dlg.coordinator = coordinator;
     dlg.ShowDialog();
     FinallyStack.Run(); // завершающие скрипты должны выполниться все равно
 }
예제 #2
0
파일: Form1.cs 프로젝트: radtek/pdaexport
 private void создатьСкриптНаБазуToolStripMenuItem_Click(object sender, EventArgs e)
 {
     // make script
     if (dlg_SaveScript.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         StreamWriter writer = new StreamWriter(dlg_SaveScript.FileName);
         Coordinator coordinator = new Coordinator();
         // add actions
         coordinator.AddAction(new ActionWriteDropScript(writer, PDATable.tables));
         coordinator.AddAction(new ActionWriteCreateTableScript(writer, PDATable.tables));
         coordinator.AddAction(new ActionWriteInsertScript(writer, PDATable.tables));
         //
         // example:coordinator.AddAction(new ActionPrepExportScripts());
         // make dialog
         dlgRunning dlg = new dlgRunning();
         dlg.Text = "Экспорт структуры";
         dlg.coordinator = coordinator;
         dlg.ShowDialog();
         writer.Close();
     }
 }
예제 #3
0
파일: Form1.cs 프로젝트: radtek/pdaexport
 private void выполнитьСкриптToolStripMenuItem_Click(object sender, EventArgs e)
 {
     // run script
     if (dlg_OpenScript.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         Coordinator coordinator = new Coordinator();
         // add actions
         coordinator.AddAction(new ActionRunScriptFromStream(dlg_OpenScript.FileName));
         //
         // example:coordinator.AddAction(new ActionPrepExportScripts());
         // make dialog
         dlgRunning dlg = new dlgRunning();
         dlg.Text = "Выполние";
         dlg.coordinator = coordinator;
         dlg.ShowDialog();
     }
 }
예제 #4
0
 void coordinator_OnExecute(Coordinator c, Coordinator.ExecuteDelegateArgs args)
 {
     List<int> value=new List<int>();
     value.Add(args.Pos);
     value.Add(args.Maximum);
     progressbar = value;
 }
예제 #5
0
 void coordinator_OnEndAction(Coordinator c, Coordinator.ExecutionActionFinishDelegateArgs args)
 {
     bool value;
     value = args.Last;
     listbox = value;
 }
예제 #6
0
 private void button4_Click(object sender, EventArgs e)
 {
     // старт экспорта
     Coordinator coordinator = new Coordinator();
     // setup actions
     coordinator.AddAction(new ActionDeploy(true));
     coordinator.AddAction(new ActionPrepExportScripts());
     coordinator.AddAction(new ActionClearLog());
     coordinator.AddAction(new ActionToTempTransferScripts(SelectedID));
     coordinator.AddAction(new ActionOracleToPDATransfer());
     coordinator.AddAction(new ActionFinishExportScripts());
     coordinator.AddAction(new ActionDeploy(false));
     coordinator.AddAction(new ActionSetBrReadOnly(SelectedID));
     // make dialog
     dlgRunning dlg = new dlgRunning();
     dlg.Text = "Экспорт";
     dlg.coordinator = coordinator;
     dlg.ShowDialog();
 }