From 06cd7752d31b4c4a34ea71db9e8b4aa74ea46ad9 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 7 Jul 2022 20:15:36 +0000 Subject: [PATCH] --- AyaNovaQBI/MainForm.Designer.cs | 39 +++++++++++++++++---------------- AyaNovaQBI/MainForm.cs | 6 +++++ 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/AyaNovaQBI/MainForm.Designer.cs b/AyaNovaQBI/MainForm.Designer.cs index db662cb..18ba1db 100644 --- a/AyaNovaQBI/MainForm.Designer.cs +++ b/AyaNovaQBI/MainForm.Designer.cs @@ -28,8 +28,8 @@ /// 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(); this.menuStrip1 = new System.Windows.Forms.MenuStrip(); this.invoicesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); @@ -41,7 +41,7 @@ this.preferencesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mapAndImportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.invoiceDescriptiveTextTemplateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.refreshQuickBooksConnectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.refreshCachedDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.onlineManualToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -127,7 +127,7 @@ this.preferencesToolStripMenuItem, this.mapAndImportToolStripMenuItem, this.invoiceDescriptiveTextTemplateToolStripMenuItem, - this.refreshQuickBooksConnectionToolStripMenuItem}); + this.refreshCachedDataToolStripMenuItem}); this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem"; this.toolsToolStripMenuItem.Size = new System.Drawing.Size(46, 20); this.toolsToolStripMenuItem.Text = "&Tools"; @@ -152,11 +152,12 @@ this.invoiceDescriptiveTextTemplateToolStripMenuItem.Size = new System.Drawing.Size(245, 22); this.invoiceDescriptiveTextTemplateToolStripMenuItem.Text = "&Invoice descriptive text template"; // - // refreshQuickBooksConnectionToolStripMenuItem + // refreshCachedDataToolStripMenuItem // - this.refreshQuickBooksConnectionToolStripMenuItem.Name = "refreshQuickBooksConnectionToolStripMenuItem"; - this.refreshQuickBooksConnectionToolStripMenuItem.Size = new System.Drawing.Size(245, 22); - this.refreshQuickBooksConnectionToolStripMenuItem.Text = "Refresh QuickBooks connection"; + this.refreshCachedDataToolStripMenuItem.Name = "refreshCachedDataToolStripMenuItem"; + this.refreshCachedDataToolStripMenuItem.Size = new System.Drawing.Size(245, 22); + this.refreshCachedDataToolStripMenuItem.Text = "Refresh cached data"; + this.refreshCachedDataToolStripMenuItem.Click += new System.EventHandler(this.refreshCachedDataToolStripMenuItem_Click); // // helpToolStripMenuItem // @@ -194,17 +195,17 @@ this.grid.AllowUserToAddRows = false; this.grid.AllowUserToDeleteRows = false; this.grid.AllowUserToResizeRows = false; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke; - this.grid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke; + this.grid.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3; this.grid.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.grid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; + 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.grid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; this.grid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.grid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.customer, @@ -336,7 +337,7 @@ private System.Windows.Forms.ToolStripMenuItem preferencesToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem mapAndImportToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem invoiceDescriptiveTextTemplateToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem refreshQuickBooksConnectionToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem refreshCachedDataToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem onlineManualToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; diff --git a/AyaNovaQBI/MainForm.cs b/AyaNovaQBI/MainForm.cs index 3af3ddf..6b821f8 100644 --- a/AyaNovaQBI/MainForm.cs +++ b/AyaNovaQBI/MainForm.cs @@ -147,5 +147,11 @@ namespace AyaNovaQBI { util.OpenWebURL("https://ayanova.com/qbi/docs"); } + + private async void refreshCachedDataToolStripMenuItem_Click(object sender, EventArgs e) + { + await util.PopulateQBListCache(); + await util.PopulateAyaListCache(); + } } }