diff --git a/AyaNovaQBI/Map.Designer.cs b/AyaNovaQBI/Map.Designer.cs index 797268a..8beff74 100644 --- a/AyaNovaQBI/Map.Designer.cs +++ b/AyaNovaQBI/Map.Designer.cs @@ -28,10 +28,10 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.objectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.customersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -45,18 +45,19 @@ this.unlinkedItemsOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.autoLinkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.updateAyaNovaPricesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.mapSelectedItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.gridAya = new System.Windows.Forms.DataGridView(); - this.gridQB = new System.Windows.Forms.DataGridView(); - this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.AyaName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.linked = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.id = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.gridQB = new System.Windows.Forms.DataGridView(); + this.dataGridViewTextBoxColumn1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewTextBoxColumn2 = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.label1 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.importSelectedItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.linkSelectedItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.gridAya)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.gridQB)).BeginInit(); @@ -73,7 +74,8 @@ this.showToolStripMenuItem, this.autoLinkToolStripMenuItem, this.updateAyaNovaPricesToolStripMenuItem, - this.mapSelectedItemsToolStripMenuItem}); + this.linkSelectedItemsToolStripMenuItem, + this.importSelectedItemsToolStripMenuItem}); this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Size = new System.Drawing.Size(783, 24); @@ -95,35 +97,35 @@ // customersToolStripMenuItem // this.customersToolStripMenuItem.Name = "customersToolStripMenuItem"; - this.customersToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.customersToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.customersToolStripMenuItem.Text = "&Customers"; this.customersToolStripMenuItem.Click += new System.EventHandler(this.customersToolStripMenuItem_Click); // // serviceRatesToolStripMenuItem // this.serviceRatesToolStripMenuItem.Name = "serviceRatesToolStripMenuItem"; - this.serviceRatesToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.serviceRatesToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.serviceRatesToolStripMenuItem.Text = "&Service rates"; this.serviceRatesToolStripMenuItem.Click += new System.EventHandler(this.serviceRatesToolStripMenuItem_Click); // // travelRatesToolStripMenuItem // this.travelRatesToolStripMenuItem.Name = "travelRatesToolStripMenuItem"; - this.travelRatesToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.travelRatesToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.travelRatesToolStripMenuItem.Text = "&Travel rates"; this.travelRatesToolStripMenuItem.Click += new System.EventHandler(this.travelRatesToolStripMenuItem_Click); // // partsToolStripMenuItem // this.partsToolStripMenuItem.Name = "partsToolStripMenuItem"; - this.partsToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.partsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.partsToolStripMenuItem.Text = "&Parts"; this.partsToolStripMenuItem.Click += new System.EventHandler(this.partsToolStripMenuItem_Click); // // vendorsToolStripMenuItem // this.vendorsToolStripMenuItem.Name = "vendorsToolStripMenuItem"; - this.vendorsToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.vendorsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.vendorsToolStripMenuItem.Text = "&Vendors"; this.vendorsToolStripMenuItem.Click += new System.EventHandler(this.vendorsToolStripMenuItem_Click); // @@ -143,7 +145,7 @@ this.allItemsToolStripMenuItem.CheckOnClick = true; this.allItemsToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; this.allItemsToolStripMenuItem.Name = "allItemsToolStripMenuItem"; - this.allItemsToolStripMenuItem.Size = new System.Drawing.Size(179, 22); + this.allItemsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.allItemsToolStripMenuItem.Text = "&All items"; this.allItemsToolStripMenuItem.Click += new System.EventHandler(this.showSubItemToolStripMenuItem_Click); // @@ -151,7 +153,7 @@ // this.linkedItemsOnlyToolStripMenuItem.CheckOnClick = true; this.linkedItemsOnlyToolStripMenuItem.Name = "linkedItemsOnlyToolStripMenuItem"; - this.linkedItemsOnlyToolStripMenuItem.Size = new System.Drawing.Size(179, 22); + this.linkedItemsOnlyToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.linkedItemsOnlyToolStripMenuItem.Text = "&Linked items only"; this.linkedItemsOnlyToolStripMenuItem.Click += new System.EventHandler(this.showSubItemToolStripMenuItem_Click); // @@ -159,7 +161,7 @@ // this.unlinkedItemsOnlyToolStripMenuItem.CheckOnClick = true; this.unlinkedItemsOnlyToolStripMenuItem.Name = "unlinkedItemsOnlyToolStripMenuItem"; - this.unlinkedItemsOnlyToolStripMenuItem.Size = new System.Drawing.Size(179, 22); + this.unlinkedItemsOnlyToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.unlinkedItemsOnlyToolStripMenuItem.Text = "&Unlinked items only"; this.unlinkedItemsOnlyToolStripMenuItem.Click += new System.EventHandler(this.showSubItemToolStripMenuItem_Click); // @@ -175,31 +177,23 @@ this.updateAyaNovaPricesToolStripMenuItem.Size = new System.Drawing.Size(142, 20); 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); - // // gridAya // this.gridAya.AllowDrop = true; this.gridAya.AllowUserToAddRows = false; this.gridAya.AllowUserToDeleteRows = false; this.gridAya.AllowUserToResizeRows = false; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke; - this.gridAya.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.WhiteSmoke; + this.gridAya.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle5; this.gridAya.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.gridAya.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle6.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))); + dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.gridAya.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6; this.gridAya.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gridAya.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.AyaName, @@ -207,124 +201,13 @@ this.id}); this.gridAya.Dock = System.Windows.Forms.DockStyle.Fill; this.gridAya.EnableHeadersVisualStyles = false; - this.gridAya.Location = new System.Drawing.Point(0, 0); + this.gridAya.Location = new System.Drawing.Point(0, 23); this.gridAya.Name = "gridAya"; this.gridAya.ReadOnly = true; - this.gridAya.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.gridAya.Size = new System.Drawing.Size(370, 533); + this.gridAya.Size = new System.Drawing.Size(338, 510); this.gridAya.TabIndex = 4; this.gridAya.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.gridAya_CellClick); - this.gridAya.SelectionChanged += new System.EventHandler(this.grid_SelectionChanged); - this.gridAya.DragDrop += new System.Windows.Forms.DragEventHandler(this.gridAya_DragDrop); - this.gridAya.DragEnter += new System.Windows.Forms.DragEventHandler(this.gridAya_DragEnter); - this.gridAya.DragOver += new System.Windows.Forms.DragEventHandler(this.gridAya_DragOver); - this.gridAya.MouseDown += new System.Windows.Forms.MouseEventHandler(this.gridAya_MouseDown); - this.gridAya.MouseMove += new System.Windows.Forms.MouseEventHandler(this.gridAya_MouseMove); - this.gridAya.MouseUp += new System.Windows.Forms.MouseEventHandler(this.gridAya_MouseUp); - // - // gridQB - // - this.gridQB.AllowDrop = true; - this.gridQB.AllowUserToAddRows = false; - this.gridQB.AllowUserToDeleteRows = false; - this.gridQB.AllowUserToResizeRows = false; - dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke; - this.gridQB.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3; - this.gridQB.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.gridQB.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; - this.gridQB.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.gridQB.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.dataGridViewTextBoxColumn1, - this.dataGridViewTextBoxColumn2, - this.dataGridViewTextBoxColumn3}); - this.gridQB.Dock = System.Windows.Forms.DockStyle.Fill; - this.gridQB.EnableHeadersVisualStyles = false; - this.gridQB.Location = new System.Drawing.Point(0, 0); - this.gridQB.Name = "gridQB"; - this.gridQB.ReadOnly = true; - this.gridQB.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.gridQB.Size = new System.Drawing.Size(381, 533); - this.gridQB.TabIndex = 5; - this.gridQB.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.gridQB_CellClick); - this.gridQB.DragDrop += new System.Windows.Forms.DragEventHandler(this.gridQB_DragDrop); - this.gridQB.DragEnter += new System.Windows.Forms.DragEventHandler(this.gridQB_DragEnter); - this.gridQB.MouseDown += new System.Windows.Forms.MouseEventHandler(this.gridQB_MouseDown); - this.gridQB.MouseMove += new System.Windows.Forms.MouseEventHandler(this.gridQB_MouseMove); - this.gridQB.MouseUp += new System.Windows.Forms.MouseEventHandler(this.gridQB_MouseUp); - // - // splitContainer1 - // - this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; - this.splitContainer1.IsSplitterFixed = true; - this.splitContainer1.Location = new System.Drawing.Point(0, 24); - this.splitContainer1.Name = "splitContainer1"; - // - // splitContainer1.Panel1 - // - this.splitContainer1.Panel1.Controls.Add(this.label1); - this.splitContainer1.Panel1.Controls.Add(this.gridAya); - // - // splitContainer1.Panel2 - // - this.splitContainer1.Panel2.Controls.Add(this.label2); - this.splitContainer1.Panel2.Controls.Add(this.gridQB); - this.splitContainer1.Size = new System.Drawing.Size(783, 533); - this.splitContainer1.SplitterDistance = 370; - this.splitContainer1.SplitterWidth = 32; - this.splitContainer1.TabIndex = 6; - // - // label1 - // - this.label1.Dock = System.Windows.Forms.DockStyle.Top; - this.label1.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.ForeColor = System.Drawing.Color.Navy; - this.label1.Location = new System.Drawing.Point(0, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(370, 23); - this.label1.TabIndex = 5; - this.label1.Text = "AyaNova"; - // - // label2 - // - this.label2.Dock = System.Windows.Forms.DockStyle.Top; - this.label2.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.ForeColor = System.Drawing.Color.ForestGreen; - this.label2.Location = new System.Drawing.Point(0, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(381, 23); - this.label2.TabIndex = 6; - this.label2.Text = "QuickBooks"; - // - // dataGridViewTextBoxColumn1 - // - this.dataGridViewTextBoxColumn1.DataPropertyName = "name"; - this.dataGridViewTextBoxColumn1.HeaderText = "Name"; - this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; - this.dataGridViewTextBoxColumn1.ReadOnly = true; - this.dataGridViewTextBoxColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; - // - // dataGridViewTextBoxColumn2 - // - this.dataGridViewTextBoxColumn2.DataPropertyName = "linked"; - this.dataGridViewTextBoxColumn2.HeaderText = "Linked"; - this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; - this.dataGridViewTextBoxColumn2.ReadOnly = true; - this.dataGridViewTextBoxColumn2.Resizable = System.Windows.Forms.DataGridViewTriState.True; - // - // dataGridViewTextBoxColumn3 - // - this.dataGridViewTextBoxColumn3.DataPropertyName = "id"; - this.dataGridViewTextBoxColumn3.HeaderText = "id"; - this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; - this.dataGridViewTextBoxColumn3.ReadOnly = true; - this.dataGridViewTextBoxColumn3.Visible = false; + this.gridAya.SelectionChanged += new System.EventHandler(this.gridAya_SelectionChanged); // // AyaName // @@ -350,6 +233,119 @@ this.id.ReadOnly = true; this.id.Visible = false; // + // gridQB + // + this.gridQB.AllowDrop = true; + this.gridQB.AllowUserToAddRows = false; + this.gridQB.AllowUserToDeleteRows = false; + this.gridQB.AllowUserToResizeRows = false; + dataGridViewCellStyle7.BackColor = System.Drawing.Color.WhiteSmoke; + this.gridQB.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7; + this.gridQB.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle8.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))); + dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.gridQB.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8; + this.gridQB.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.gridQB.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.dataGridViewTextBoxColumn1, + this.dataGridViewTextBoxColumn2, + this.dataGridViewTextBoxColumn3}); + this.gridQB.Dock = System.Windows.Forms.DockStyle.Fill; + this.gridQB.EnableHeadersVisualStyles = false; + this.gridQB.Location = new System.Drawing.Point(0, 23); + this.gridQB.Name = "gridQB"; + this.gridQB.ReadOnly = true; + this.gridQB.Size = new System.Drawing.Size(381, 510); + this.gridQB.TabIndex = 5; + this.gridQB.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.gridQB_CellClick); + this.gridQB.SelectionChanged += new System.EventHandler(this.gridQB_SelectionChanged); + // + // dataGridViewTextBoxColumn1 + // + this.dataGridViewTextBoxColumn1.DataPropertyName = "name"; + this.dataGridViewTextBoxColumn1.HeaderText = "Name"; + this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; + this.dataGridViewTextBoxColumn1.ReadOnly = true; + this.dataGridViewTextBoxColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + // + // dataGridViewTextBoxColumn2 + // + this.dataGridViewTextBoxColumn2.DataPropertyName = "linked"; + this.dataGridViewTextBoxColumn2.HeaderText = "Linked"; + this.dataGridViewTextBoxColumn2.Name = "dataGridViewTextBoxColumn2"; + this.dataGridViewTextBoxColumn2.ReadOnly = true; + this.dataGridViewTextBoxColumn2.Resizable = System.Windows.Forms.DataGridViewTriState.True; + // + // dataGridViewTextBoxColumn3 + // + this.dataGridViewTextBoxColumn3.DataPropertyName = "id"; + this.dataGridViewTextBoxColumn3.HeaderText = "id"; + this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; + this.dataGridViewTextBoxColumn3.ReadOnly = true; + this.dataGridViewTextBoxColumn3.Visible = false; + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.IsSplitterFixed = true; + this.splitContainer1.Location = new System.Drawing.Point(0, 24); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.gridAya); + this.splitContainer1.Panel1.Controls.Add(this.label1); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.gridQB); + this.splitContainer1.Panel2.Controls.Add(this.label2); + this.splitContainer1.Size = new System.Drawing.Size(783, 533); + this.splitContainer1.SplitterDistance = 338; + this.splitContainer1.SplitterWidth = 64; + this.splitContainer1.TabIndex = 6; + // + // label1 + // + this.label1.Dock = System.Windows.Forms.DockStyle.Top; + this.label1.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.ForeColor = System.Drawing.Color.Navy; + this.label1.Location = new System.Drawing.Point(0, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(338, 23); + this.label1.TabIndex = 5; + this.label1.Text = "AyaNova"; + // + // label2 + // + this.label2.Dock = System.Windows.Forms.DockStyle.Top; + this.label2.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label2.ForeColor = System.Drawing.Color.ForestGreen; + this.label2.Location = new System.Drawing.Point(0, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(381, 23); + this.label2.TabIndex = 6; + this.label2.Text = "QuickBooks"; + // + // importSelectedItemsToolStripMenuItem + // + this.importSelectedItemsToolStripMenuItem.Name = "importSelectedItemsToolStripMenuItem"; + this.importSelectedItemsToolStripMenuItem.Size = new System.Drawing.Size(133, 20); + this.importSelectedItemsToolStripMenuItem.Text = "&Import selected items"; + this.importSelectedItemsToolStripMenuItem.Click += new System.EventHandler(this.importSelectedItemsToolStripMenuItem_Click); + // + // linkSelectedItemsToolStripMenuItem + // + this.linkSelectedItemsToolStripMenuItem.Name = "linkSelectedItemsToolStripMenuItem"; + this.linkSelectedItemsToolStripMenuItem.Size = new System.Drawing.Size(119, 20); + this.linkSelectedItemsToolStripMenuItem.Text = "&Link selected items"; + this.linkSelectedItemsToolStripMenuItem.Click += new System.EventHandler(this.linkSelectedItemsToolStripMenuItem_Click); + // // Map // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -360,6 +356,7 @@ this.MainMenuStrip = this.menuStrip1; this.Name = "Map"; this.Text = "Map"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Load += new System.EventHandler(this.Map_Load); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); @@ -390,7 +387,6 @@ private System.Windows.Forms.ToolStripMenuItem autoLinkToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem updateAyaNovaPricesToolStripMenuItem; private System.Windows.Forms.DataGridView gridAya; - private System.Windows.Forms.ToolStripMenuItem mapSelectedItemsToolStripMenuItem; private System.Windows.Forms.DataGridView gridQB; private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.Label label1; @@ -401,5 +397,7 @@ private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn1; private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewTextBoxColumn2; private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn3; + private System.Windows.Forms.ToolStripMenuItem importSelectedItemsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem linkSelectedItemsToolStripMenuItem; } } \ No newline at end of file diff --git a/AyaNovaQBI/Map.cs b/AyaNovaQBI/Map.cs index 82ae0a2..7347ad4 100644 --- a/AyaNovaQBI/Map.cs +++ b/AyaNovaQBI/Map.cs @@ -385,132 +385,66 @@ namespace AyaNovaQBI } - private void grid_SelectionChanged(object sender, EventArgs e) - { - var hasSelection = gridAya.SelectedRows.Count > 0; - mapSelectedItemsToolStripMenuItem.Visible = hasSelection; - } + + + + + //public class QBNameID + //{ + // public string Name { get; set; } + // public string ID { get; set; } + //} + + //List SelectedQBItems = new List(); + + //public class AyaNameID + //{ + // public string Name { get; set; } + // public long ID { get; set; } + //} + //List SelectedAyaItems = new List(); + //private bool m_dragging = false; + //Rectangle dragBoxFromMouseDown; + //int rowIndexFromMouseDown; + //int rowIndexOfItemUnderMouseToDrop; + + + //private void gridAya_MouseDown(object sender, MouseEventArgs e) + //{ + // if (e.Button != MouseButtons.Left) + // return; - #region Drag n drop - public class QBNameID - { - public string Name { get; set; } - public string ID { get; set; } - } + // //Only do this if the user is positioned over a row + // rowIndexFromMouseDown = gridAya.HitTest(e.X, e.Y).RowIndex; + // if ((rowIndexFromMouseDown != -1)) + // { + // SelectedAyaItems.Clear(); + // if (gridAya.SelectedRows.Count > 0 && !gridAya.SelectedRows[0].IsNewRow) + // { + // foreach (DataGridViewRow r in gridAya.SelectedRows) + // { + // SelectedAyaItems.Add(new AyaNameID { Name = (string)r.Cells[0].Value, ID = (long)r.Cells[1].Value }); + // } + // //Size dragSize = SystemInformation.DragSize; + // //dragBoxFromMouseDown = new Rectangle(new Point(e.X - (dragSize.Width / 2), e.Y - (dragSize.Height / 2)), dragSize); + // m_dragging = true; + // } + // } + // else + // { + // // dragBoxFromMouseDown = Rectangle.Empty; - List SelectedQBItems = new List(); - - public class AyaNameID - { - public string Name { get; set; } - public long ID { get; set; } - } - List SelectedAyaItems = new List(); + // } + //} + - private bool m_dragging = false; - Rectangle dragBoxFromMouseDown; - int rowIndexFromMouseDown; - int rowIndexOfItemUnderMouseToDrop; - - #region AyaGrid - private void gridAya_MouseDown(object sender, MouseEventArgs e) - { - if (e.Button != MouseButtons.Left) - return; - - - //Only do this if the user is positioned over a row - rowIndexFromMouseDown = gridAya.HitTest(e.X, e.Y).RowIndex; - if ((rowIndexFromMouseDown != -1)) - { - SelectedAyaItems.Clear(); - if (gridAya.SelectedRows.Count > 0 && !gridAya.SelectedRows[0].IsNewRow) - { - foreach (DataGridViewRow r in gridAya.SelectedRows) - { - SelectedAyaItems.Add(new AyaNameID { Name = (string)r.Cells[0].Value, ID = (long)r.Cells[1].Value }); - } - //Size dragSize = SystemInformation.DragSize; - //dragBoxFromMouseDown = new Rectangle(new Point(e.X - (dragSize.Width / 2), e.Y - (dragSize.Height / 2)), dragSize); - m_dragging = true; - } - } - else - { - // dragBoxFromMouseDown = Rectangle.Empty; - - } - } - - private void gridAya_MouseUp(object sender, MouseEventArgs e) - { - m_dragging = false; - } - - private void gridAya_MouseMove(object sender, MouseEventArgs e) - { - if (e.Button == MouseButtons.Left - && m_dragging - && SelectedAyaItems.Count > 0) - { - - gridAya.DoDragDrop(null, DragDropEffects.Link); - } - - //if (((e.Button == MouseButtons.Left))) - //{ - // if (((dragBoxFromMouseDown != Rectangle.Empty) - // && !dragBoxFromMouseDown.Contains(e.X, e.Y))) - // { - // DragDropEffects dropEffect = gridAya.DoDragDrop(gridAya.Rows[rowIndexFromMouseDown], DragDropEffects.Move); - // } - //} - } - - private void gridAya_DragOver(object sender, DragEventArgs e) - { - // e.Effect = DragDropEffects.Move; - } - - private void gridAya_DragEnter(object sender, DragEventArgs e) - { - if (SelectedQBItems.Count > 0) - { - - e.Effect = DragDropEffects.Link; - } - else - e.Effect = DragDropEffects.None; - } - - private void gridAya_DragDrop(object sender, DragEventArgs e) - { - MessageBox.Show("STUB: aya drop data happened"); - //Point clientPoint = gridAya.PointToClient(new Point(e.X, e.Y)); - //rowIndexOfItemUnderMouseToDrop = gridAya.HitTest(clientPoint.X, clientPoint.Y).RowIndex; - //if ((e.Effect == DragDropEffects.Move)) - //{ - // DataGridViewRow rowToMove = (DataGridViewRow)e.Data.GetData(typeof(DataGridViewRow)); - // object[] celldata = new object[gridAya.ColumnCount]; - // for (int col = 0; (col - // <= (rowToMove.Cells.Count - 1)); col++) - // { - // celldata[col] = rowToMove.Cells[col].Value; - // } - - // //DataRow row = bsPeople.NewRow(); - // //row.ItemArray = celldata; - // //bsPeople.Rows.InsertAt(row, rowIndexOfItemUnderMouseToDrop); - // //rowToMove.DataGridView.Rows.Remove(rowToMove); - - //} - } + private void gridAya_CellClick(object sender, DataGridViewCellEventArgs e) { @@ -518,45 +452,44 @@ namespace AyaNovaQBI } - #endregion ayagrid - - #region QBGrid - - private void gridQB_MouseDown(object sender, MouseEventArgs e) - { - - } - - private void gridQB_MouseUp(object sender, MouseEventArgs e) - { - - } - - private void gridQB_MouseMove(object sender, MouseEventArgs e) - { - - } - - private void gridQB_DragEnter(object sender, DragEventArgs e) - { - - } - - private void gridQB_DragDrop(object sender, DragEventArgs e) - { - - } + + private void gridQB_CellClick(object sender, DataGridViewCellEventArgs e) { } + private void gridQB_SelectionChanged(object sender, EventArgs e) + { + var hasSelection = gridQB.SelectedRows.Count > 0; + importSelectedItemsToolStripMenuItem.Visible=linkSelectedItemsToolStripMenuItem.Visible = hasSelection; + if (hasSelection) + gridAya.ClearSelection(); + } + + private void gridAya_SelectionChanged(object sender, EventArgs e) + { + var hasSelection = gridAya.SelectedRows.Count > 0; + importSelectedItemsToolStripMenuItem.Visible = linkSelectedItemsToolStripMenuItem.Visible = hasSelection; + if (hasSelection) + gridQB.ClearSelection(); + } + + + private void importSelectedItemsToolStripMenuItem_Click(object sender, EventArgs e) + { + + } + + private void linkSelectedItemsToolStripMenuItem_Click(object sender, EventArgs e) + { + + } + - #endregion qbgrid - #endregion drag and drop /* * Simplified, no drag and drop just pick and choose with clicks