Ejemplo n.º 1
0
 protected async override void OnExecute(object parameter)
 {
     var viewModel = parameter as LogInfoViewModel;
     var table     = viewModel.Target as ITable;
     var dialog    = new DiffDataTableViewModel(this.Initialize(viewModel, table))
     {
         DisplayName = Resources.Title_CompareWithPreviousResivision,
     };
     await dialog.ShowDialogAsync();
 }
        protected async override void OnExecute(object parameter)
        {
            var tableDescriptor = parameter as ITableDescriptor;
            var table           = tableDescriptor.Target;

            var dialog = new DiffDataTableViewModel(this.Initialize(table))
            {
                DisplayName = Resources.Title_CompareWithPreviousResivision,
            };
            await dialog.ShowDialogAsync();
        }
Ejemplo n.º 3
0
        protected override async void OnExecute(object parameter)
        {
            var tableDescriptor = parameter as ITableDescriptor;
            var table           = tableDescriptor.Target;
            var tableName       = tableDescriptor.TableInfo.Name;

            var dataBaseName = await this.SelectDataBaseAsync();

            if (dataBaseName == null)
            {
                return;
            }

            var dataSet1 = await this.PreviewOtherTableAsync(dataBaseName, tableName);

            if (dataSet1 != null)
            {
                var dataSet2 = await table.GetDataSetAsync(this.authenticator, null);

                var dataSet = new DiffDataSet(dataSet1, dataSet2)
                {
                    Header1 = $"{dataBaseName}: {tableName}",
                    Header2 = $"{this.cremaAppHost.DataBaseName}: {tableName}",
                };

                var dialog = new DiffDataTableViewModel(dataSet.Tables.First())
                {
                    DisplayName = Resources.Title_CompareWithOtherDataBase,
                };
                await dialog.ShowDialogAsync();
            }
            else
            {
                await AppMessageBox.ShowAsync(string.Format(Resources.Message_TableNotFound_Format, tableName));
            }
        }