This commit is contained in:
2022-07-06 21:41:18 +00:00
parent 6003ce8adb
commit 507b641d11
2 changed files with 122 additions and 104 deletions

View File

@@ -981,6 +981,8 @@ namespace AyaNovaQBI
//Rates are not offered - same as v7 //Rates are not offered - same as v7
if (gridAya.SelectedRows.Count == 0 && gridQB.SelectedRows.Count == 0) return; if (gridAya.SelectedRows.Count == 0 && gridQB.SelectedRows.Count == 0) return;
bool IsAyaGrid = false; bool IsAyaGrid = false;
IsAyaGrid = gridAya.SelectedRows.Count > 0; IsAyaGrid = gridAya.SelectedRows.Count > 0;
@@ -1015,7 +1017,11 @@ namespace AyaNovaQBI
s.Dispose(); s.Dispose();
Waiting w = new Waiting();
w.Show();
w.Ops = $"Updating {sTo} {sType} from {sFrom}...";
try
{
bool SaveIntegration = false; bool SaveIntegration = false;
@@ -1041,6 +1047,7 @@ namespace AyaNovaQBI
{ {
string AyaName = r.Cells[0].Value.ToString(); string AyaName = r.Cells[0].Value.ToString();
long AyaId = (long)r.Cells[1].Value; long AyaId = (long)r.Cells[1].Value;
w.Step = AyaName;
//only linked items can be updated //only linked items can be updated
IntegrationItem im = util.QBIntegration.Items.FirstOrDefault(z => z.ObjectId == AyaId && z.AType == _Type); IntegrationItem im = util.QBIntegration.Items.FirstOrDefault(z => z.ObjectId == AyaId && z.AType == _Type);
@@ -1083,8 +1090,9 @@ namespace AyaNovaQBI
foreach (DataGridViewRow r in gridQB.SelectedRows) foreach (DataGridViewRow r in gridQB.SelectedRows)
{ {
// var QBItemName = gridQB.SelectedRows[0].Cells[0].Value.ToString(); var QBItemName = gridQB.SelectedRows[0].Cells[0].Value.ToString();
var QBItemId = gridQB.SelectedRows[0].Cells[1].Value.ToString(); var QBItemId = r.Cells[1].Value.ToString();
w.Step = QBItemName;
//only linked items can be updated //only linked items can be updated
IntegrationItem im = util.QBIntegration.Items.FirstOrDefault(z => z.IntegrationItemId == QBItemId && z.AType == _Type); IntegrationItem im = util.QBIntegration.Items.FirstOrDefault(z => z.IntegrationItemId == QBItemId && z.AType == _Type);
@@ -1130,6 +1138,16 @@ namespace AyaNovaQBI
await util.SaveIntegrationObject(); await util.SaveIntegrationObject();
Initialize(); Initialize();
} }
}
catch (Exception ex)
{
w.Visible = false;
await util.CrackDisplayAndIntegrationLogException(ex, "QBI:Map:UpdateSelectedItems");
}
finally
{
w.Close();
}

View File

@@ -38,7 +38,7 @@
this.lblOps.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblOps.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblOps.Location = new System.Drawing.Point(0, 0); this.lblOps.Location = new System.Drawing.Point(0, 0);
this.lblOps.Name = "lblOps"; this.lblOps.Name = "lblOps";
this.lblOps.Size = new System.Drawing.Size(345, 28); this.lblOps.Size = new System.Drawing.Size(464, 28);
this.lblOps.TabIndex = 0; this.lblOps.TabIndex = 0;
this.lblOps.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblOps.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
@@ -48,7 +48,7 @@
this.lblStep.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblStep.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblStep.Location = new System.Drawing.Point(0, 28); this.lblStep.Location = new System.Drawing.Point(0, 28);
this.lblStep.Name = "lblStep"; this.lblStep.Name = "lblStep";
this.lblStep.Size = new System.Drawing.Size(345, 28); this.lblStep.Size = new System.Drawing.Size(464, 28);
this.lblStep.TabIndex = 1; this.lblStep.TabIndex = 1;
this.lblStep.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblStep.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
@@ -57,7 +57,7 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Window; this.BackColor = System.Drawing.SystemColors.Window;
this.ClientSize = new System.Drawing.Size(345, 66); this.ClientSize = new System.Drawing.Size(464, 71);
this.ControlBox = false; this.ControlBox = false;
this.Controls.Add(this.lblStep); this.Controls.Add(this.lblStep);
this.Controls.Add(this.lblOps); this.Controls.Add(this.lblOps);