From 384a78535ca3dec7dca8ab819499ce4f1f5fe567 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sun, 3 Jul 2022 21:12:46 +0000 Subject: [PATCH] --- AyaNovaQBI/Map.cs | 22 +++++++++++----------- AyaNovaQBI/MapSelectQBItem.Designer.cs | 8 ++++---- AyaNovaQBI/MapSelectQBItem.cs | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/AyaNovaQBI/Map.cs b/AyaNovaQBI/Map.cs index 884ccd1..14900c7 100644 --- a/AyaNovaQBI/Map.cs +++ b/AyaNovaQBI/Map.cs @@ -117,7 +117,7 @@ namespace AyaNovaQBI //Is AyaNova object already mapped? - IntegrationItem m = util.QBIntegration.Items.FirstOrDefault(z => z.Id == AyaId && z.AType == _Type); + IntegrationItem m = util.QBIntegration.Items.FirstOrDefault(z => z.ObjectId == AyaId && z.AType == _Type); if (m != null) { //Is it already linked to the selected qb object? @@ -148,7 +148,7 @@ namespace AyaNovaQBI else { //user is removing mapping so remove the integrationitem entirely from the collection - util.QBIntegration.Items.Remove(m); + var didremove=util.QBIntegration.Items.Remove(m); SaveIntegration = true; } @@ -256,11 +256,11 @@ namespace AyaNovaQBI bool bLinked = util.QBIntegration.Items.Any(z => z.AType == _Type && z.ObjectId == i.Id); if (DisplayRow(bLinked)) { - var qbItem = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.Id == i.Id); - if (qbItem == null) - { - qbItem = new IntegrationItem(); - } + //var qbItem = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.Id == i.Id); + //if (qbItem == null) + //{ + // qbItem = new IntegrationItem(); + //} _aya.Rows.Add(new object[] { i.Name, i.Id, bLinked }); } @@ -287,7 +287,7 @@ namespace AyaNovaQBI bool bLinked = util.QBIntegration.Items.Any(z => z.AType == _Type && z.ObjectId == i.Id); if (DisplayRow(bLinked)) { - var qbItem = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.Id == i.Id); + //var qbItem = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.Id == i.Id); _aya.Rows.Add(new object[] { i.Name, i.Id, bLinked }); } @@ -326,7 +326,7 @@ namespace AyaNovaQBI bool bLinked = util.QBIntegration.Items.Any(z => z.AType == _Type && z.ObjectId == i.Id); if (DisplayRow(bLinked)) { - var qbItem = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.Id == i.Id); + // var qbItem = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.Id == i.Id); _aya.Rows.Add(new object[] { i.Name, i.Id, bLinked }); } @@ -369,7 +369,7 @@ namespace AyaNovaQBI bool bLinked = util.QBIntegration.Items.Any(z => z.AType == _Type && z.ObjectId == i.Id); if (DisplayRow(bLinked)) { - var qbItem = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.Id == i.Id); + // var qbItem = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.Id == i.Id); _aya.Rows.Add(new object[] { i.Name, i.Id, bLinked }); } @@ -405,7 +405,7 @@ namespace AyaNovaQBI bool bLinked = util.QBIntegration.Items.Any(z => z.AType == _Type && z.ObjectId == i.Id); if (DisplayRow(bLinked)) { - var qbItem = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.Id == i.Id); + //var qbItem = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.Id == i.Id); _aya.Rows.Add(new object[] { i.Name, i.Id, bLinked }); } diff --git a/AyaNovaQBI/MapSelectQBItem.Designer.cs b/AyaNovaQBI/MapSelectQBItem.Designer.cs index 2dbad21..21c6140 100644 --- a/AyaNovaQBI/MapSelectQBItem.Designer.cs +++ b/AyaNovaQBI/MapSelectQBItem.Designer.cs @@ -42,7 +42,7 @@ this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(715, 13); this.label1.TabIndex = 0; - this.label1.Text = "Map selected AyaNova items to:"; + this.label1.Text = "Link selected AyaNova items to:"; // // cbQBItems // @@ -78,11 +78,11 @@ // ckNothing // this.ckNothing.AutoSize = true; - this.ckNothing.Location = new System.Drawing.Point(16, 56); + this.ckNothing.Location = new System.Drawing.Point(16, 59); this.ckNothing.Name = "ckNothing"; - this.ckNothing.Size = new System.Drawing.Size(80, 17); + this.ckNothing.Size = new System.Drawing.Size(133, 17); this.ckNothing.TabIndex = 15; - this.ckNothing.Text = "checkBox1"; + this.ckNothing.Text = "Nothing / Remove link"; this.ckNothing.UseVisualStyleBackColor = true; this.ckNothing.CheckedChanged += new System.EventHandler(this.ckNothing_CheckedChanged); // diff --git a/AyaNovaQBI/MapSelectQBItem.cs b/AyaNovaQBI/MapSelectQBItem.cs index 2b24142..c1a5e20 100644 --- a/AyaNovaQBI/MapSelectQBItem.cs +++ b/AyaNovaQBI/MapSelectQBItem.cs @@ -21,7 +21,7 @@ namespace AyaNovaQBI { get { - if (ckNothing.Checked) return ""; + if (ckNothing.Checked) return "Nothing / Remove link"; return ((DataRowView)cbQBItems.SelectedItem).Row[0].ToString(); } }