This commit is contained in:
2022-07-06 21:52:14 +00:00
parent 507b641d11
commit d11dba69f9
2 changed files with 15 additions and 5 deletions

View File

@@ -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

View File

@@ -1022,7 +1022,7 @@ namespace AyaNovaQBI
w.Ops = $"Updating {sTo} {sType} from {sFrom}...";
try
{
menuStrip1.Enabled = gridQB.Enabled = gridAya.Enabled = false;
bool SaveIntegration = false;
@@ -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;
}