示例#1
0
        public static async Task GetDifferences <T>(this ConverterRowBase <T> row) where T : class, IDocumentDTO
        {
            row.StartBeingBusy("Getting row differences ...");
            row.ErrorText = null;
            await Task.Delay(1);

            var diffs = await row.QueryThenCompare();

            UIThread.Run(() => row.DiffRows.SetItems(diffs));
            row.UpdateCounts();
            row.ShowFirstDiff();
            row.StopBeingBusy();
        }
        public static async Task UpdateRnt <T>(this ConverterRowBase <T> row) where T : class, IDocumentDTO
        {
            row.StartBeingBusy($"Importing all {row.Label} ...");
            await Task.Delay(1);

            await Task.Run(() =>
            {
                try
                {
                    var recs = row.DiffRows.Select(_ => _.Document1 as T);
                    row.ReplaceAll(recs, row.Main.AppArgs.MarketState);
                }
                catch (Exception ex)
                {
                    row.LogError(ex.Info(true, true));
                }
            });

            await Task.Delay(500);

            row.StopBeingBusy();
            row.RefreshCmd.ExecuteIfItCan();
        }