This commit is contained in:
2022-07-02 23:02:34 +00:00
parent 7c874b5674
commit ab9b014162
2 changed files with 62 additions and 43 deletions

View File

@@ -28,10 +28,10 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.objectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.objectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.customersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.customersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -72,10 +72,10 @@
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.objectToolStripMenuItem, this.objectToolStripMenuItem,
this.showToolStripMenuItem, this.showToolStripMenuItem,
this.autoLinkToolStripMenuItem,
this.updateAyaNovaPricesToolStripMenuItem,
this.linkSelectedItemsToolStripMenuItem, this.linkSelectedItemsToolStripMenuItem,
this.importSelectedItemsToolStripMenuItem}); this.importSelectedItemsToolStripMenuItem,
this.autoLinkToolStripMenuItem,
this.updateAyaNovaPricesToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(783, 24); this.menuStrip1.Size = new System.Drawing.Size(783, 24);
@@ -91,11 +91,14 @@
this.partsToolStripMenuItem, this.partsToolStripMenuItem,
this.vendorsToolStripMenuItem}); this.vendorsToolStripMenuItem});
this.objectToolStripMenuItem.Name = "objectToolStripMenuItem"; this.objectToolStripMenuItem.Name = "objectToolStripMenuItem";
this.objectToolStripMenuItem.Size = new System.Drawing.Size(54, 20); this.objectToolStripMenuItem.Size = new System.Drawing.Size(80, 20);
this.objectToolStripMenuItem.Text = "&Object"; this.objectToolStripMenuItem.Text = "&Object type";
// //
// customersToolStripMenuItem // customersToolStripMenuItem
// //
this.customersToolStripMenuItem.Checked = true;
this.customersToolStripMenuItem.CheckOnClick = true;
this.customersToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.customersToolStripMenuItem.Name = "customersToolStripMenuItem"; this.customersToolStripMenuItem.Name = "customersToolStripMenuItem";
this.customersToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.customersToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.customersToolStripMenuItem.Text = "&Customers"; this.customersToolStripMenuItem.Text = "&Customers";
@@ -103,6 +106,7 @@
// //
// serviceRatesToolStripMenuItem // serviceRatesToolStripMenuItem
// //
this.serviceRatesToolStripMenuItem.CheckOnClick = true;
this.serviceRatesToolStripMenuItem.Name = "serviceRatesToolStripMenuItem"; this.serviceRatesToolStripMenuItem.Name = "serviceRatesToolStripMenuItem";
this.serviceRatesToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.serviceRatesToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.serviceRatesToolStripMenuItem.Text = "&Service rates"; this.serviceRatesToolStripMenuItem.Text = "&Service rates";
@@ -110,6 +114,7 @@
// //
// travelRatesToolStripMenuItem // travelRatesToolStripMenuItem
// //
this.travelRatesToolStripMenuItem.CheckOnClick = true;
this.travelRatesToolStripMenuItem.Name = "travelRatesToolStripMenuItem"; this.travelRatesToolStripMenuItem.Name = "travelRatesToolStripMenuItem";
this.travelRatesToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.travelRatesToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.travelRatesToolStripMenuItem.Text = "&Travel rates"; this.travelRatesToolStripMenuItem.Text = "&Travel rates";
@@ -117,6 +122,7 @@
// //
// partsToolStripMenuItem // partsToolStripMenuItem
// //
this.partsToolStripMenuItem.CheckOnClick = true;
this.partsToolStripMenuItem.Name = "partsToolStripMenuItem"; this.partsToolStripMenuItem.Name = "partsToolStripMenuItem";
this.partsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.partsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.partsToolStripMenuItem.Text = "&Parts"; this.partsToolStripMenuItem.Text = "&Parts";
@@ -124,6 +130,7 @@
// //
// vendorsToolStripMenuItem // vendorsToolStripMenuItem
// //
this.vendorsToolStripMenuItem.CheckOnClick = true;
this.vendorsToolStripMenuItem.Name = "vendorsToolStripMenuItem"; this.vendorsToolStripMenuItem.Name = "vendorsToolStripMenuItem";
this.vendorsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.vendorsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.vendorsToolStripMenuItem.Text = "&Vendors"; this.vendorsToolStripMenuItem.Text = "&Vendors";
@@ -183,17 +190,17 @@
this.gridAya.AllowUserToAddRows = false; this.gridAya.AllowUserToAddRows = false;
this.gridAya.AllowUserToDeleteRows = false; this.gridAya.AllowUserToDeleteRows = false;
this.gridAya.AllowUserToResizeRows = false; this.gridAya.AllowUserToResizeRows = false;
dataGridViewCellStyle5.BackColor = System.Drawing.Color.WhiteSmoke; dataGridViewCellStyle9.BackColor = System.Drawing.Color.WhiteSmoke;
this.gridAya.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.gridAya.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9;
this.gridAya.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.gridAya.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle10.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.gridAya.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6; this.gridAya.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10;
this.gridAya.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gridAya.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridAya.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.gridAya.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.AyaName, this.AyaName,
@@ -239,17 +246,17 @@
this.gridQB.AllowUserToAddRows = false; this.gridQB.AllowUserToAddRows = false;
this.gridQB.AllowUserToDeleteRows = false; this.gridQB.AllowUserToDeleteRows = false;
this.gridQB.AllowUserToResizeRows = false; this.gridQB.AllowUserToResizeRows = false;
dataGridViewCellStyle7.BackColor = System.Drawing.Color.WhiteSmoke; dataGridViewCellStyle11.BackColor = System.Drawing.Color.WhiteSmoke;
this.gridQB.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7; this.gridQB.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle11;
this.gridQB.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; this.gridQB.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle8.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.gridQB.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8; this.gridQB.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle12;
this.gridQB.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gridQB.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridQB.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.gridQB.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.dataGridViewTextBoxColumn1, this.dataGridViewTextBoxColumn1,

View File

@@ -317,8 +317,6 @@ namespace AyaNovaQBI
private void showSubItemToolStripMenuItem_Click(object sender, EventArgs e) private void showSubItemToolStripMenuItem_Click(object sender, EventArgs e)
{ {
// Set the current clicked item to item // Set the current clicked item to item
@@ -362,33 +360,47 @@ namespace AyaNovaQBI
private void customersToolStripMenuItem_Click(object sender, EventArgs e) private void customersToolStripMenuItem_Click(object sender, EventArgs e)
{ {
handleCheckOfObjectTypeMenuItem(sender, e);
} }
private void serviceRatesToolStripMenuItem_Click(object sender, EventArgs e) private void serviceRatesToolStripMenuItem_Click(object sender, EventArgs e)
{ {
handleCheckOfObjectTypeMenuItem(sender, e);
} }
private void travelRatesToolStripMenuItem_Click(object sender, EventArgs e) private void travelRatesToolStripMenuItem_Click(object sender, EventArgs e)
{ {
handleCheckOfObjectTypeMenuItem(sender, e);
} }
private void partsToolStripMenuItem_Click(object sender, EventArgs e) private void partsToolStripMenuItem_Click(object sender, EventArgs e)
{ {
handleCheckOfObjectTypeMenuItem(sender, e);
} }
private void vendorsToolStripMenuItem_Click(object sender, EventArgs e) private void vendorsToolStripMenuItem_Click(object sender, EventArgs e)
{ {
handleCheckOfObjectTypeMenuItem(sender, e);
} }
private void handleCheckOfObjectTypeMenuItem(object sender, EventArgs e)
{
// Set the current clicked item to item
ToolStripMenuItem item = sender as ToolStripMenuItem;
// Loop through all items in the subMenu and uncheck them but do check the clicked item
foreach (ToolStripMenuItem tempItemp in objectToolStripMenuItem.DropDownItems)
{
if (tempItemp == item)
tempItemp.Checked = true;
else
tempItemp.Checked = false;
}
}
//public class QBNameID //public class QBNameID
//{ //{
// public string Name { get; set; } // public string Name { get; set; }
@@ -411,7 +423,7 @@ namespace AyaNovaQBI
//int rowIndexFromMouseDown; //int rowIndexFromMouseDown;
//int rowIndexOfItemUnderMouseToDrop; //int rowIndexOfItemUnderMouseToDrop;
//private void gridAya_MouseDown(object sender, MouseEventArgs e) //private void gridAya_MouseDown(object sender, MouseEventArgs e)
//{ //{
// if (e.Button != MouseButtons.Left) // if (e.Button != MouseButtons.Left)
@@ -442,9 +454,9 @@ namespace AyaNovaQBI
//} //}
private void gridAya_CellClick(object sender, DataGridViewCellEventArgs e) private void gridAya_CellClick(object sender, DataGridViewCellEventArgs e)
{ {
@@ -463,7 +475,7 @@ namespace AyaNovaQBI
private void gridQB_SelectionChanged(object sender, EventArgs e) private void gridQB_SelectionChanged(object sender, EventArgs e)
{ {
var hasSelection = gridQB.SelectedRows.Count > 0; var hasSelection = gridQB.SelectedRows.Count > 0;
importSelectedItemsToolStripMenuItem.Visible=linkSelectedItemsToolStripMenuItem.Visible = hasSelection;
if (hasSelection) if (hasSelection)
gridAya.ClearSelection(); gridAya.ClearSelection();
} }
@@ -471,7 +483,7 @@ namespace AyaNovaQBI
private void gridAya_SelectionChanged(object sender, EventArgs e) private void gridAya_SelectionChanged(object sender, EventArgs e)
{ {
var hasSelection = gridAya.SelectedRows.Count > 0; var hasSelection = gridAya.SelectedRows.Count > 0;
importSelectedItemsToolStripMenuItem.Visible = linkSelectedItemsToolStripMenuItem.Visible = hasSelection;
if (hasSelection) if (hasSelection)
gridQB.ClearSelection(); gridQB.ClearSelection();
} }