From 40a720bcc954bbc1f979e0c1300a7513ae388513 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 1 Jul 2022 16:48:28 +0000 Subject: [PATCH] --- AyaNovaQBI/AyaNovaQBI.csproj | 9 ++ AyaNovaQBI/SetToBePrinted.Designer.cs | 128 ++++++++++++++++++++++++++ AyaNovaQBI/SetToBePrinted.cs | 56 +++++++++++ AyaNovaQBI/SetToBePrinted.resx | 120 ++++++++++++++++++++++++ AyaNovaQBI/util.cs | 59 ++++++------ 5 files changed, 339 insertions(+), 33 deletions(-) create mode 100644 AyaNovaQBI/SetToBePrinted.Designer.cs create mode 100644 AyaNovaQBI/SetToBePrinted.cs create mode 100644 AyaNovaQBI/SetToBePrinted.resx diff --git a/AyaNovaQBI/AyaNovaQBI.csproj b/AyaNovaQBI/AyaNovaQBI.csproj index 2d551a9..873265f 100644 --- a/AyaNovaQBI/AyaNovaQBI.csproj +++ b/AyaNovaQBI/AyaNovaQBI.csproj @@ -135,6 +135,12 @@ SetQBTerms.cs + + Form + + + SetToBePrinted.cs + Form @@ -194,6 +200,9 @@ SetQBTerms.cs + + SetToBePrinted.cs + SetWOStatus.cs diff --git a/AyaNovaQBI/SetToBePrinted.Designer.cs b/AyaNovaQBI/SetToBePrinted.Designer.cs new file mode 100644 index 0000000..092bbf6 --- /dev/null +++ b/AyaNovaQBI/SetToBePrinted.Designer.cs @@ -0,0 +1,128 @@ +namespace AyaNovaQBI +{ + partial class SetToBePrinted + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.lblTitle = new System.Windows.Forms.Label(); + this.lblDescription = new System.Windows.Forms.Label(); + this.lblStatus = new System.Windows.Forms.Label(); + this.ckPrinted = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point(550, 368); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(75, 23); + this.btnOK.TabIndex = 6; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(4, 368); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 5; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // lblTitle + // + this.lblTitle.Dock = System.Windows.Forms.DockStyle.Top; + this.lblTitle.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblTitle.Location = new System.Drawing.Point(0, 0); + this.lblTitle.Name = "lblTitle"; + this.lblTitle.Size = new System.Drawing.Size(637, 30); + this.lblTitle.TabIndex = 7; + // + // lblDescription + // + this.lblDescription.Dock = System.Windows.Forms.DockStyle.Top; + this.lblDescription.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblDescription.Location = new System.Drawing.Point(0, 30); + this.lblDescription.Name = "lblDescription"; + this.lblDescription.Size = new System.Drawing.Size(637, 165); + this.lblDescription.TabIndex = 8; + // + // lblStatus + // + this.lblStatus.AutoSize = true; + this.lblStatus.Dock = System.Windows.Forms.DockStyle.Top; + this.lblStatus.Location = new System.Drawing.Point(0, 195); + this.lblStatus.Name = "lblStatus"; + this.lblStatus.Size = new System.Drawing.Size(0, 13); + this.lblStatus.TabIndex = 10; + // + // ckPrinted + // + this.ckPrinted.AutoSize = true; + this.ckPrinted.Dock = System.Windows.Forms.DockStyle.Top; + this.ckPrinted.Location = new System.Drawing.Point(0, 208); + this.ckPrinted.Name = "ckPrinted"; + this.ckPrinted.Size = new System.Drawing.Size(637, 17); + this.ckPrinted.TabIndex = 11; + this.ckPrinted.Text = "Set to be printed"; + this.ckPrinted.UseVisualStyleBackColor = true; + // + // SetToBePrinted + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(637, 403); + this.Controls.Add(this.ckPrinted); + this.Controls.Add(this.lblStatus); + this.Controls.Add(this.lblDescription); + this.Controls.Add(this.lblTitle); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.btnCancel); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.Name = "SetToBePrinted"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "SetToBePrinted"; + this.Load += new System.EventHandler(this.SetQBClass_load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Label lblTitle; + private System.Windows.Forms.Label lblDescription; + private System.Windows.Forms.Label lblStatus; + private System.Windows.Forms.CheckBox ckPrinted; + } +} \ No newline at end of file diff --git a/AyaNovaQBI/SetToBePrinted.cs b/AyaNovaQBI/SetToBePrinted.cs new file mode 100644 index 0000000..19bc0e8 --- /dev/null +++ b/AyaNovaQBI/SetToBePrinted.cs @@ -0,0 +1,56 @@ +using System; +using System.Data; +using System.Windows.Forms; + +namespace AyaNovaQBI +{ + public partial class SetToBePrinted : Form + { + public SetToBePrinted() + { + InitializeComponent(); + } + + + public string DialogTitle { get; set; } + + public string OptionTitle { get; set; } + + public string OptionDescription { get; set; } + + + + + + private void SetQBClass_load(object sender, EventArgs e) + { + Text = DialogTitle; + lblDescription.Text = OptionDescription; + lblTitle.Text = OptionTitle; + btnCancel.Text = util.AyaTranslations["Cancel"]; + btnOK.Text = util.AyaTranslations["OK"]; + } + + public bool ToBePrinted + { + get + { + return this.ckPrinted.Checked; + } + set + { + this.ckPrinted.Checked = value; + } + } + + + + + private void btnOK_Click(object sender, EventArgs e) + { + + DialogResult = DialogResult.OK; + Close(); + } + } +} diff --git a/AyaNovaQBI/SetToBePrinted.resx b/AyaNovaQBI/SetToBePrinted.resx new file mode 100644 index 0000000..29dcb1b --- /dev/null +++ b/AyaNovaQBI/SetToBePrinted.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/AyaNovaQBI/util.cs b/AyaNovaQBI/util.cs index e30bad4..55d6405 100644 --- a/AyaNovaQBI/util.cs +++ b/AyaNovaQBI/util.cs @@ -1202,48 +1202,41 @@ namespace AyaNovaQBI #endregion - // #region ToBePrinted - // //No validation possible - // //so prompt only if not setup yet - // if (!SetEverything) - // { - // //if(QBItems.Rows.Contains(QDat.MiscExpenseChargeAs)) - // goto TBPOK; - // // else - // // { - // // MessageBox.Show("The QuickBooks Item previously set for invoicing Misc. Expense items\r\n" + - // // "No longer appears to be valid. You will next be prompted to re-select a valid \r\n" + - // // "QuickBooks Item."); - // // } - // } + #region ToBePrinted + //No validation possible + //so prompt only if not setup yet + if (!SetEverything) + { + goto TBPOK; + } - // SetToBePrinted s4 = new SetToBePrinted(); - // s4.DialogTitle = "AyaNova QBI setup - Set invoice to be printed?"; - // s4.OptionTitle = "Invoice to be printed"; - // s4.OptionDescription = "QBI needs to know if you want invoices that it creates \r\n" + - // "in QuickBooks to be set to \"To be printed\".\r\n\r\n" + - // "(Please note that \"To be emailed\" which is available in some\r\n" + - // "versions of QuickBooks is not an option at this time as\r\n" + - // "QuickBooks has not exposed that property to developers)"; - // s4.ToBePrinted = QDat.ToBePrinted; + SetToBePrinted s4 = new SetToBePrinted(); + s4.DialogTitle = "AyaNova QBI setup - Set invoice to be printed?"; + s4.OptionTitle = "Invoice to be printed"; + s4.OptionDescription = "QBI needs to know if you want invoices that it creates \r\n" + + "in QuickBooks to be set to \"To be printed\".\r\n\r\n" + + "(Please note that \"To be emailed\" which is available in some\r\n" + + "versions of QuickBooks is not an option at this time as\r\n" + + "QuickBooks has not exposed that property to developers)"; + s4.ToBePrinted = QDat.ToBePrinted; - // if (s4.ShowDialog() == DialogResult.Cancel) - // { - // return pfstat.Cancel; + if (s4.ShowDialog() == DialogResult.Cancel) + { + return pfstat.Cancel; - // } - // else - // QDat.ToBePrinted = s4.ToBePrinted; - // s4.Dispose(); - // s4 = null; + } + else + QDat.ToBePrinted = s4.ToBePrinted; + s4.Dispose(); + s4 = null; - //TBPOK: + TBPOK: - // #endregion + #endregion // #region SetMemoField // //No validation possible