diff --git a/AyaNovaQBI/FixInvoiceProblems.cs b/AyaNovaQBI/FixInvoiceProblems.cs index 90400de..7f19cee 100644 --- a/AyaNovaQBI/FixInvoiceProblems.cs +++ b/AyaNovaQBI/FixInvoiceProblems.cs @@ -1,9 +1,11 @@ using System; using System.Collections; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Windows.Forms; +using static AyaNovaQBI.util; namespace AyaNovaQBI { @@ -19,16 +21,25 @@ namespace AyaNovaQBI private void FixInvoiceProblems_Load(object sender, EventArgs e) { - grid.DataSource = MisMatches; + BindDataSource(); btnOK.Text = util.AyaTranslations["OK"]; } + private void BindDataSource() + { + + var bindingList = new BindingList(MisMatches); + var source = new BindingSource(bindingList, null); + grid.DataSource = source; + } + private void btnOK_Click(object sender, EventArgs e) { DialogResult = DialogResult.OK; Close(); } + TODO: Test each possible route through this below before moving on to invoice testing private async void grid_CellContentClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; @@ -107,13 +118,13 @@ namespace AyaNovaQBI } //remove the object from the grid as it's now dealt with + MisMatches.RemoveAt(e.RowIndex); ChangesMade = true; //If all done then close up if (MisMatches.Count == 0) Close(); - else - grid.DataSource = MisMatches;//rebind to refresh the grid + } catch (Exception ex) { @@ -255,13 +266,15 @@ namespace AyaNovaQBI REMOVEITEMS: //remove the object from the grid as it's now dealt with + // grid.Rows.RemoveAt(e.RowIndex); + //grid.DataSource = typeof(List); MisMatches.RemoveAt(e.RowIndex); + BindDataSource(); ChangesMade = true; //If all done then close up if (MisMatches.Count == 0) Close(); - else - grid.DataSource = MisMatches;//rebind to refresh the grid + } catch (Exception ex) diff --git a/AyaNovaQBI/FixPriceDifference.Designer.cs b/AyaNovaQBI/FixPriceDifference.Designer.cs index 2a33e6e..9abcb89 100644 --- a/AyaNovaQBI/FixPriceDifference.Designer.cs +++ b/AyaNovaQBI/FixPriceDifference.Designer.cs @@ -150,6 +150,7 @@ this.Controls.Add(this.lblTitle); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.Name = "FixPriceDifference"; + this.ShowInTaskbar = false; this.Text = "Resolve AyaNova object price"; this.Load += new System.EventHandler(this.SetQBClass_load); this.groupBox1.ResumeLayout(false); diff --git a/AyaNovaQBI/LinkOrImportAyaObject.cs b/AyaNovaQBI/LinkOrImportAyaObject.cs index 70e9e5a..5222603 100644 --- a/AyaNovaQBI/LinkOrImportAyaObject.cs +++ b/AyaNovaQBI/LinkOrImportAyaObject.cs @@ -17,7 +17,7 @@ namespace AyaNovaQBI { get { - return ((DataRowView)cbQBItems.SelectedItem).Row[0].ToString(); + return ((DataRowView)cbQBItems.SelectedItem).Row[1].ToString(); } } @@ -25,7 +25,7 @@ namespace AyaNovaQBI { get { - return ((DataRowView)cbQBItems.SelectedItem).Row[1].ToString(); + return ((DataRowView)cbQBItems.SelectedItem).Row[0].ToString(); } } diff --git a/docs/docs/img/fix-problems-price-dialog.png b/docs/docs/img/fix-problems-price-dialog.png new file mode 100644 index 0000000..47714f2 Binary files /dev/null and b/docs/docs/img/fix-problems-price-dialog.png differ diff --git a/docs/docs/img/fix-problems.png b/docs/docs/img/fix-problems.png index 1df60e6..d612fa2 100644 Binary files a/docs/docs/img/fix-problems.png and b/docs/docs/img/fix-problems.png differ