From 2c6dd7a90b65604409b6ef96125bc904d1db2f46 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sun, 10 Jul 2022 02:02:42 +0000 Subject: [PATCH] --- AyaNovaQBI/FixPriceDifference.Designer.cs | 107 ++++++++++++++++------ AyaNovaQBI/FixPriceDifference.cs | 28 +++--- 2 files changed, 96 insertions(+), 39 deletions(-) diff --git a/AyaNovaQBI/FixPriceDifference.Designer.cs b/AyaNovaQBI/FixPriceDifference.Designer.cs index 51727b4..a3da009 100644 --- a/AyaNovaQBI/FixPriceDifference.Designer.cs +++ b/AyaNovaQBI/FixPriceDifference.Designer.cs @@ -31,8 +31,12 @@ this.btnOK = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button(); this.lblTitle = new System.Windows.Forms.Label(); - this.lblStatus = new System.Windows.Forms.Label(); - this.cbQBClasses = new System.Windows.Forms.ComboBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.rbChangeQB = new System.Windows.Forms.RadioButton(); + this.rbChangeAya = new System.Windows.Forms.RadioButton(); + this.rbQBOnce = new System.Windows.Forms.RadioButton(); + this.rbAyaOnce = new System.Windows.Forms.RadioButton(); + this.groupBox1.SuspendLayout(); this.SuspendLayout(); // // btnOK @@ -54,57 +58,103 @@ this.btnCancel.TabIndex = 5; this.btnCancel.Text = "Cancel"; this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); // // lblTitle // this.lblTitle.BackColor = System.Drawing.SystemColors.Window; - this.lblTitle.Dock = System.Windows.Forms.DockStyle.Top; this.lblTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblTitle.ForeColor = System.Drawing.SystemColors.WindowText; - this.lblTitle.Location = new System.Drawing.Point(0, 0); + this.lblTitle.Location = new System.Drawing.Point(4, 0); this.lblTitle.Name = "lblTitle"; - this.lblTitle.Size = new System.Drawing.Size(637, 84); + this.lblTitle.Size = new System.Drawing.Size(628, 74); this.lblTitle.TabIndex = 7; this.lblTitle.Text = "title"; this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // lblStatus + // groupBox1 // - this.lblStatus.AutoSize = true; - this.lblStatus.Dock = System.Windows.Forms.DockStyle.Top; - this.lblStatus.Location = new System.Drawing.Point(0, 84); - this.lblStatus.Name = "lblStatus"; - this.lblStatus.Size = new System.Drawing.Size(0, 13); - this.lblStatus.TabIndex = 10; + this.groupBox1.Controls.Add(this.rbChangeQB); + this.groupBox1.Controls.Add(this.rbChangeAya); + this.groupBox1.Controls.Add(this.rbQBOnce); + this.groupBox1.Controls.Add(this.rbAyaOnce); + this.groupBox1.Location = new System.Drawing.Point(4, 77); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(628, 153); + this.groupBox1.TabIndex = 11; + this.groupBox1.TabStop = false; // - // cbQBClasses + // rbChangeQB // - this.cbQBClasses.Dock = System.Windows.Forms.DockStyle.Top; - this.cbQBClasses.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbQBClasses.FormattingEnabled = true; - this.cbQBClasses.Location = new System.Drawing.Point(0, 97); - this.cbQBClasses.Name = "cbQBClasses"; - this.cbQBClasses.Size = new System.Drawing.Size(637, 21); - this.cbQBClasses.TabIndex = 11; + this.rbChangeQB.AutoSize = true; + this.rbChangeQB.Location = new System.Drawing.Point(9, 119); + this.rbChangeQB.Name = "rbChangeQB"; + this.rbChangeQB.Size = new System.Drawing.Size(420, 17); + this.rbChangeQB.TabIndex = 3; + this.rbChangeQB.TabStop = true; + this.rbChangeQB.Tag = "CHANGEQB"; + this.rbChangeQB.Text = "Change the QuickBooks object\'s default price to be the AyaNova price from now on"; + this.rbChangeQB.UseVisualStyleBackColor = true; + this.rbChangeQB.CheckedChanged += new System.EventHandler(this.rb_CheckedChanged); + // + // rbChangeAya + // + this.rbChangeAya.AutoSize = true; + this.rbChangeAya.Location = new System.Drawing.Point(9, 86); + this.rbChangeAya.Name = "rbChangeAya"; + this.rbChangeAya.Size = new System.Drawing.Size(420, 17); + this.rbChangeAya.TabIndex = 2; + this.rbChangeAya.TabStop = true; + this.rbChangeAya.Tag = "CHANGEAYA"; + this.rbChangeAya.Text = "Change the AyaNova object\'s default price to be the QuickBooks price from now on"; + this.rbChangeAya.UseVisualStyleBackColor = true; + this.rbChangeAya.CheckedChanged += new System.EventHandler(this.rb_CheckedChanged); + // + // rbQBOnce + // + this.rbQBOnce.AutoSize = true; + this.rbQBOnce.Location = new System.Drawing.Point(9, 53); + this.rbQBOnce.Name = "rbQBOnce"; + this.rbQBOnce.Size = new System.Drawing.Size(305, 17); + this.rbQBOnce.TabIndex = 1; + this.rbQBOnce.TabStop = true; + this.rbQBOnce.Tag = "QBONCE"; + this.rbQBOnce.Text = "Change the work order item\'s price to the QuickBooks price"; + this.rbQBOnce.UseVisualStyleBackColor = true; + this.rbQBOnce.CheckedChanged += new System.EventHandler(this.rb_CheckedChanged); + // + // rbAyaOnce + // + this.rbAyaOnce.AutoSize = true; + this.rbAyaOnce.Location = new System.Drawing.Point(9, 20); + this.rbAyaOnce.Name = "rbAyaOnce"; + this.rbAyaOnce.Size = new System.Drawing.Size(295, 17); + this.rbAyaOnce.TabIndex = 0; + this.rbAyaOnce.TabStop = true; + this.rbAyaOnce.Tag = "AYAONCE"; + this.rbAyaOnce.Text = "Use the work order price as it is; even though it\'s different"; + this.rbAyaOnce.UseVisualStyleBackColor = true; + this.rbAyaOnce.CheckedChanged += new System.EventHandler(this.rb_CheckedChanged); // // FixPriceDifference // + this.AcceptButton = this.btnOK; 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.cbQBClasses); - this.Controls.Add(this.lblStatus); - this.Controls.Add(this.lblTitle); + this.Controls.Add(this.groupBox1); this.Controls.Add(this.btnOK); this.Controls.Add(this.btnCancel); + this.Controls.Add(this.lblTitle); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.Name = "FixPriceDifference"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "FixPriceDifference"; + this.Text = "Resolve AyaNova object price"; this.Load += new System.EventHandler(this.SetQBClass_load); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); this.ResumeLayout(false); - this.PerformLayout(); } @@ -113,7 +163,10 @@ private System.Windows.Forms.Button btnOK; private System.Windows.Forms.Button btnCancel; private System.Windows.Forms.Label lblTitle; - private System.Windows.Forms.Label lblStatus; - private System.Windows.Forms.ComboBox cbQBClasses; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.RadioButton rbChangeQB; + private System.Windows.Forms.RadioButton rbChangeAya; + private System.Windows.Forms.RadioButton rbQBOnce; + private System.Windows.Forms.RadioButton rbAyaOnce; } } \ No newline at end of file diff --git a/AyaNovaQBI/FixPriceDifference.cs b/AyaNovaQBI/FixPriceDifference.cs index 055ee68..9fa33ed 100644 --- a/AyaNovaQBI/FixPriceDifference.cs +++ b/AyaNovaQBI/FixPriceDifference.cs @@ -12,29 +12,22 @@ namespace AyaNovaQBI } - public string DialogTitle { get; set; } public string OptionTitle { get; set; } - public string OptionDescription { get; set; } - - - public DataTable QBClasses { get; set; } - public string SelectedQBClass { get; set; } + + public string SelectedResolution { get; set; } = "AYAONCE"; 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"]; + rbAyaOnce.Checked = true; - cbQBClasses.DataSource = QBClasses; - cbQBClasses.DisplayMember = "FullName"; - cbQBClasses.ValueMember = "ID"; - lblStatus.Text = "QuickBooks transaction class"; } @@ -44,5 +37,16 @@ namespace AyaNovaQBI DialogResult = DialogResult.OK; Close(); } + + private void btnCancel_Click(object sender, EventArgs e) + { + DialogResult = DialogResult.Cancel; + Close(); + } + + private void rb_CheckedChanged(object sender, EventArgs e) + { + SelectedResolution = ((RadioButton)sender).Tag.ToString(); + } } }