From d11dba69f91235a87d22f1b3567443d6e8c95c40 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 6 Jul 2022 21:52:14 +0000 Subject: [PATCH] --- AyaNovaQBI/MainForm.Designer.cs | 2 +- AyaNovaQBI/Map.cs | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/AyaNovaQBI/MainForm.Designer.cs b/AyaNovaQBI/MainForm.Designer.cs index ac963e9..9a89075 100644 --- a/AyaNovaQBI/MainForm.Designer.cs +++ b/AyaNovaQBI/MainForm.Designer.cs @@ -144,7 +144,7 @@ // this.mapAndImportToolStripMenuItem.Name = "mapAndImportToolStripMenuItem"; this.mapAndImportToolStripMenuItem.Size = new System.Drawing.Size(245, 22); - this.mapAndImportToolStripMenuItem.Text = "&LInk and import"; + this.mapAndImportToolStripMenuItem.Text = "&Link and synchronize"; this.mapAndImportToolStripMenuItem.Click += new System.EventHandler(this.mapAndImportToolStripMenuItem_Click); // // invoiceDescriptiveTextTemplateToolStripMenuItem diff --git a/AyaNovaQBI/Map.cs b/AyaNovaQBI/Map.cs index 9df10f3..b5cc42a 100644 --- a/AyaNovaQBI/Map.cs +++ b/AyaNovaQBI/Map.cs @@ -1022,8 +1022,8 @@ namespace AyaNovaQBI w.Ops = $"Updating {sTo} {sType} from {sFrom}..."; try { + menuStrip1.Enabled = gridQB.Enabled = gridAya.Enabled = false; - bool SaveIntegration = false; if (IsAyaGrid) @@ -1047,12 +1047,13 @@ namespace AyaNovaQBI { string AyaName = r.Cells[0].Value.ToString(); long AyaId = (long)r.Cells[1].Value; - w.Step = AyaName; + //only linked items can be updated IntegrationItem im = util.QBIntegration.Items.FirstOrDefault(z => z.ObjectId == AyaId && z.AType == _Type); if (im != null) { + w.Step = AyaName; switch (_Type) { case AyaType.Customer: @@ -1072,12 +1073,15 @@ namespace AyaNovaQBI { case AyaType.Customer: + w.Step = "Refreshing AyaNova Customers cache"; await util.PopulateAyaClientList(); break; case AyaType.Vendor: + w.Step = "Refreshing AyaNova Vendors cache"; await util.PopulateAyaVendorList(); break; case AyaType.Part: + w.Step = "Refreshing AyaNova Parts cache"; await util.PopulateAyaPartList(); break; } @@ -1090,14 +1094,15 @@ namespace AyaNovaQBI foreach (DataGridViewRow r in gridQB.SelectedRows) { - var QBItemName = gridQB.SelectedRows[0].Cells[0].Value.ToString(); + var QBItemName = r.Cells[0].Value.ToString(); var QBItemId = r.Cells[1].Value.ToString(); - w.Step = QBItemName; + //only linked items can be updated IntegrationItem im = util.QBIntegration.Items.FirstOrDefault(z => z.IntegrationItemId == QBItemId && z.AType == _Type); if (im != null) { + w.Step = QBItemName; switch (_Type) { @@ -1115,17 +1120,21 @@ namespace AyaNovaQBI } } + switch (_Type) { case AyaType.Customer: + w.Step = "Refreshing QB Customers cache"; await util.PopulateQBClientCacheAsync(); break; case AyaType.Vendor: + w.Step = "Refreshing QB Vendors cache"; await util.PopulateQBVendorCacheAsync(); break; case AyaType.ServiceRate: case AyaType.TravelRate: case AyaType.Part: + w.Step = "Refreshing QB Items cache"; await util.PopulateQBItemCacheAsync(); break; } @@ -1147,6 +1156,7 @@ namespace AyaNovaQBI finally { w.Close(); + menuStrip1.Enabled = gridQB.Enabled = gridAya.Enabled = true; }