public void Excute() { WaitDialogForm sdf = null; try { DataSyncConfig config = DataSyncConfig.GetDataSyncConfig(); if (config != null) { DataSyncDirection dataSyncDirection = SenderMenu.Name.Equals(DataSyncMenuNames.DataSyncPageDoDataSyncGroupInnerDoDataSyncMenu) ? DataSyncDirection.InnerDataSync : DataSyncDirection.OuterDataSync; sdf = new WaitDialogForm("提示", "正在同步数据......"); dataSyncOperator.SyncData(config, dataSyncDirection); string filePath = dataCapture.CaptureDirtyFromDBAndSave(config, dataSyncDirection); //打开数据 SyncDataResource syncDataResource = iocManager.Resolve <SyncDataResource>(); syncDataResource.FullName = filePath; syncDataResource.Open(); XtraMessageBox.Show(dataSyncDirection == DataSyncDirection.InnerDataSync ? "内网数据同步完成" : "外网数据同步完成"); } else { Logger.Warn("未找到数据同步的配置。/DataOperation/DataCaptureConfig.json"); } } catch (Exception ex) { EventBus.Default.Trigger(new NonUIExceptionEventData { UnhandledExceptionEventArgs = new UnhandledExceptionEventArgs(ex, false) }); } finally { sdf.Close(); } }
public void Excute() { try { DataSyncConfig config = DataSyncConfig.GetDataSyncConfig(); if (config != null) { DataSyncDirection dataSyncDirection = SenderMenu.Name.Equals(DataSyncMenuNames.DataSyncPageSqlCreateGroupInnerDataInitMenu) ? DataSyncDirection.InnerDataSync : DataSyncDirection.OuterDataSync; string result = triggerOperation.DoDBTriggerOperation(config, dataSyncDirection); TextShowDialog textShowDialog = new TextShowDialog(); textShowDialog.SetText(result); textShowDialog.ShowDialog(); } else { Logger.Warn("未找到数据同步的配置。/DataOperation/DataCaptureConfig.json"); } } catch (Exception ex) { EventBus.Default.Trigger(new NonUIExceptionEventData { UnhandledExceptionEventArgs = new UnhandledExceptionEventArgs(ex, false) }); } }