This commit is contained in:
2022-07-02 17:53:32 +00:00
parent a79df80743
commit fd6000dddd
2 changed files with 38 additions and 28 deletions

View File

@@ -43,9 +43,9 @@
this.unlinkedItemsOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.unlinkedItemsOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.autoLinkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.autoLinkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.updateAyaNovaPricesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.updateAyaNovaPricesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.grid = new System.Windows.Forms.DataGridView();
this.mapSelectedItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mapSelectedItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.unmapSelectedItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.unmapSelectedItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.grid = new System.Windows.Forms.DataGridView();
this.AyaName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.AyaName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.QBName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.QBName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.qbid = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.qbid = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -84,35 +84,35 @@
// customersToolStripMenuItem // customersToolStripMenuItem
// //
this.customersToolStripMenuItem.Name = "customersToolStripMenuItem"; this.customersToolStripMenuItem.Name = "customersToolStripMenuItem";
this.customersToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.customersToolStripMenuItem.Size = new System.Drawing.Size(139, 22);
this.customersToolStripMenuItem.Text = "&Customers"; this.customersToolStripMenuItem.Text = "&Customers";
this.customersToolStripMenuItem.Click += new System.EventHandler(this.customersToolStripMenuItem_Click); this.customersToolStripMenuItem.Click += new System.EventHandler(this.customersToolStripMenuItem_Click);
// //
// serviceRatesToolStripMenuItem // serviceRatesToolStripMenuItem
// //
this.serviceRatesToolStripMenuItem.Name = "serviceRatesToolStripMenuItem"; this.serviceRatesToolStripMenuItem.Name = "serviceRatesToolStripMenuItem";
this.serviceRatesToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.serviceRatesToolStripMenuItem.Size = new System.Drawing.Size(139, 22);
this.serviceRatesToolStripMenuItem.Text = "&Service rates"; this.serviceRatesToolStripMenuItem.Text = "&Service rates";
this.serviceRatesToolStripMenuItem.Click += new System.EventHandler(this.serviceRatesToolStripMenuItem_Click); this.serviceRatesToolStripMenuItem.Click += new System.EventHandler(this.serviceRatesToolStripMenuItem_Click);
// //
// travelRatesToolStripMenuItem // travelRatesToolStripMenuItem
// //
this.travelRatesToolStripMenuItem.Name = "travelRatesToolStripMenuItem"; this.travelRatesToolStripMenuItem.Name = "travelRatesToolStripMenuItem";
this.travelRatesToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.travelRatesToolStripMenuItem.Size = new System.Drawing.Size(139, 22);
this.travelRatesToolStripMenuItem.Text = "&Travel rates"; this.travelRatesToolStripMenuItem.Text = "&Travel rates";
this.travelRatesToolStripMenuItem.Click += new System.EventHandler(this.travelRatesToolStripMenuItem_Click); this.travelRatesToolStripMenuItem.Click += new System.EventHandler(this.travelRatesToolStripMenuItem_Click);
// //
// partsToolStripMenuItem // partsToolStripMenuItem
// //
this.partsToolStripMenuItem.Name = "partsToolStripMenuItem"; this.partsToolStripMenuItem.Name = "partsToolStripMenuItem";
this.partsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.partsToolStripMenuItem.Size = new System.Drawing.Size(139, 22);
this.partsToolStripMenuItem.Text = "&Parts"; this.partsToolStripMenuItem.Text = "&Parts";
this.partsToolStripMenuItem.Click += new System.EventHandler(this.partsToolStripMenuItem_Click); this.partsToolStripMenuItem.Click += new System.EventHandler(this.partsToolStripMenuItem_Click);
// //
// vendorsToolStripMenuItem // vendorsToolStripMenuItem
// //
this.vendorsToolStripMenuItem.Name = "vendorsToolStripMenuItem"; this.vendorsToolStripMenuItem.Name = "vendorsToolStripMenuItem";
this.vendorsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.vendorsToolStripMenuItem.Size = new System.Drawing.Size(139, 22);
this.vendorsToolStripMenuItem.Text = "&Vendors"; this.vendorsToolStripMenuItem.Text = "&Vendors";
this.vendorsToolStripMenuItem.Click += new System.EventHandler(this.vendorsToolStripMenuItem_Click); this.vendorsToolStripMenuItem.Click += new System.EventHandler(this.vendorsToolStripMenuItem_Click);
// //
@@ -132,7 +132,7 @@
this.allItemsToolStripMenuItem.CheckOnClick = true; this.allItemsToolStripMenuItem.CheckOnClick = true;
this.allItemsToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.allItemsToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.allItemsToolStripMenuItem.Name = "allItemsToolStripMenuItem"; this.allItemsToolStripMenuItem.Name = "allItemsToolStripMenuItem";
this.allItemsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.allItemsToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.allItemsToolStripMenuItem.Text = "&All items"; this.allItemsToolStripMenuItem.Text = "&All items";
this.allItemsToolStripMenuItem.Click += new System.EventHandler(this.showSubItemToolStripMenuItem_Click); this.allItemsToolStripMenuItem.Click += new System.EventHandler(this.showSubItemToolStripMenuItem_Click);
// //
@@ -140,7 +140,7 @@
// //
this.linkedItemsOnlyToolStripMenuItem.CheckOnClick = true; this.linkedItemsOnlyToolStripMenuItem.CheckOnClick = true;
this.linkedItemsOnlyToolStripMenuItem.Name = "linkedItemsOnlyToolStripMenuItem"; this.linkedItemsOnlyToolStripMenuItem.Name = "linkedItemsOnlyToolStripMenuItem";
this.linkedItemsOnlyToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.linkedItemsOnlyToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.linkedItemsOnlyToolStripMenuItem.Text = "&Linked items only"; this.linkedItemsOnlyToolStripMenuItem.Text = "&Linked items only";
this.linkedItemsOnlyToolStripMenuItem.Click += new System.EventHandler(this.showSubItemToolStripMenuItem_Click); this.linkedItemsOnlyToolStripMenuItem.Click += new System.EventHandler(this.showSubItemToolStripMenuItem_Click);
// //
@@ -148,7 +148,7 @@
// //
this.unlinkedItemsOnlyToolStripMenuItem.CheckOnClick = true; this.unlinkedItemsOnlyToolStripMenuItem.CheckOnClick = true;
this.unlinkedItemsOnlyToolStripMenuItem.Name = "unlinkedItemsOnlyToolStripMenuItem"; this.unlinkedItemsOnlyToolStripMenuItem.Name = "unlinkedItemsOnlyToolStripMenuItem";
this.unlinkedItemsOnlyToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.unlinkedItemsOnlyToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.unlinkedItemsOnlyToolStripMenuItem.Text = "&Unlinked items only"; this.unlinkedItemsOnlyToolStripMenuItem.Text = "&Unlinked items only";
this.unlinkedItemsOnlyToolStripMenuItem.Click += new System.EventHandler(this.showSubItemToolStripMenuItem_Click); this.unlinkedItemsOnlyToolStripMenuItem.Click += new System.EventHandler(this.showSubItemToolStripMenuItem_Click);
// //
@@ -164,6 +164,22 @@
this.updateAyaNovaPricesToolStripMenuItem.Size = new System.Drawing.Size(142, 20); this.updateAyaNovaPricesToolStripMenuItem.Size = new System.Drawing.Size(142, 20);
this.updateAyaNovaPricesToolStripMenuItem.Text = "Update AyaNova &prices"; this.updateAyaNovaPricesToolStripMenuItem.Text = "Update AyaNova &prices";
// //
// mapSelectedItemsToolStripMenuItem
//
this.mapSelectedItemsToolStripMenuItem.Name = "mapSelectedItemsToolStripMenuItem";
this.mapSelectedItemsToolStripMenuItem.Size = new System.Drawing.Size(121, 20);
this.mapSelectedItemsToolStripMenuItem.Text = "&Map selected items";
this.mapSelectedItemsToolStripMenuItem.Visible = false;
this.mapSelectedItemsToolStripMenuItem.Click += new System.EventHandler(this.mapSelectedItemsToolStripMenuItem_Click);
//
// unmapSelectedItemsToolStripMenuItem
//
this.unmapSelectedItemsToolStripMenuItem.Name = "unmapSelectedItemsToolStripMenuItem";
this.unmapSelectedItemsToolStripMenuItem.Size = new System.Drawing.Size(136, 20);
this.unmapSelectedItemsToolStripMenuItem.Text = "&Unmap selected items";
this.unmapSelectedItemsToolStripMenuItem.Visible = false;
this.unmapSelectedItemsToolStripMenuItem.Click += new System.EventHandler(this.unmapSelectedItemsToolStripMenuItem_Click);
//
// grid // grid
// //
this.grid.AllowUserToAddRows = false; this.grid.AllowUserToAddRows = false;
@@ -194,22 +210,7 @@
this.grid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.grid.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.grid.Size = new System.Drawing.Size(800, 426); this.grid.Size = new System.Drawing.Size(800, 426);
this.grid.TabIndex = 4; this.grid.TabIndex = 4;
// this.grid.SelectionChanged += new System.EventHandler(this.grid_SelectionChanged);
// mapSelectedItemsToolStripMenuItem
//
this.mapSelectedItemsToolStripMenuItem.Name = "mapSelectedItemsToolStripMenuItem";
this.mapSelectedItemsToolStripMenuItem.Size = new System.Drawing.Size(121, 20);
this.mapSelectedItemsToolStripMenuItem.Text = "&Map selected items";
this.mapSelectedItemsToolStripMenuItem.Visible = false;
this.mapSelectedItemsToolStripMenuItem.Click += new System.EventHandler(this.mapSelectedItemsToolStripMenuItem_Click);
//
// unmapSelectedItemsToolStripMenuItem
//
this.unmapSelectedItemsToolStripMenuItem.Name = "unmapSelectedItemsToolStripMenuItem";
this.unmapSelectedItemsToolStripMenuItem.Size = new System.Drawing.Size(136, 20);
this.unmapSelectedItemsToolStripMenuItem.Text = "&Unmap selected items";
this.unmapSelectedItemsToolStripMenuItem.Visible = false;
this.unmapSelectedItemsToolStripMenuItem.Click += new System.EventHandler(this.unmapSelectedItemsToolStripMenuItem_Click);
// //
// AyaName // AyaName
// //

View File

@@ -306,12 +306,14 @@ namespace AyaNovaQBI
private void mapSelectedItemsToolStripMenuItem_Click(object sender, EventArgs e) private void mapSelectedItemsToolStripMenuItem_Click(object sender, EventArgs e)
{ {
var selection = grid.SelectedRows;
MessageBox.Show($"MAP: selected row count {selection.Count}");
} }
private void unmapSelectedItemsToolStripMenuItem_Click(object sender, EventArgs e) private void unmapSelectedItemsToolStripMenuItem_Click(object sender, EventArgs e)
{ {
var selection = grid.SelectedRows;
MessageBox.Show($"UNMAP: selected row count {selection.Count}");
} }
private void customersToolStripMenuItem_Click(object sender, EventArgs e) private void customersToolStripMenuItem_Click(object sender, EventArgs e)
@@ -339,7 +341,14 @@ namespace AyaNovaQBI
} }
private void grid_SelectionChanged(object sender, EventArgs e)
{
var hasSelection = grid.SelectedRows.Count > 0;
mapSelectedItemsToolStripMenuItem.Visible = hasSelection;
unmapSelectedItemsToolStripMenuItem.Visible = hasSelection;
}
/* /*
* Simplified, no drag and drop just pick and choose with clicks * Simplified, no drag and drop just pick and choose with clicks