This commit is contained in:
2022-07-10 02:02:42 +00:00
parent 2e26823b2f
commit 2c6dd7a90b
2 changed files with 96 additions and 39 deletions

View File

@@ -31,8 +31,12 @@
this.btnOK = new System.Windows.Forms.Button(); this.btnOK = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button();
this.lblTitle = new System.Windows.Forms.Label(); this.lblTitle = new System.Windows.Forms.Label();
this.lblStatus = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox();
this.cbQBClasses = new System.Windows.Forms.ComboBox(); 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(); this.SuspendLayout();
// //
// btnOK // btnOK
@@ -54,57 +58,103 @@
this.btnCancel.TabIndex = 5; this.btnCancel.TabIndex = 5;
this.btnCancel.Text = "Cancel"; this.btnCancel.Text = "Cancel";
this.btnCancel.UseVisualStyleBackColor = true; this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
// //
// lblTitle // lblTitle
// //
this.lblTitle.BackColor = System.Drawing.SystemColors.Window; 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.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.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.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.TabIndex = 7;
this.lblTitle.Text = "title"; this.lblTitle.Text = "title";
this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
// //
// lblStatus // groupBox1
// //
this.lblStatus.AutoSize = true; this.groupBox1.Controls.Add(this.rbChangeQB);
this.lblStatus.Dock = System.Windows.Forms.DockStyle.Top; this.groupBox1.Controls.Add(this.rbChangeAya);
this.lblStatus.Location = new System.Drawing.Point(0, 84); this.groupBox1.Controls.Add(this.rbQBOnce);
this.lblStatus.Name = "lblStatus"; this.groupBox1.Controls.Add(this.rbAyaOnce);
this.lblStatus.Size = new System.Drawing.Size(0, 13); this.groupBox1.Location = new System.Drawing.Point(4, 77);
this.lblStatus.TabIndex = 10; 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.rbChangeQB.AutoSize = true;
this.cbQBClasses.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.rbChangeQB.Location = new System.Drawing.Point(9, 119);
this.cbQBClasses.FormattingEnabled = true; this.rbChangeQB.Name = "rbChangeQB";
this.cbQBClasses.Location = new System.Drawing.Point(0, 97); this.rbChangeQB.Size = new System.Drawing.Size(420, 17);
this.cbQBClasses.Name = "cbQBClasses"; this.rbChangeQB.TabIndex = 3;
this.cbQBClasses.Size = new System.Drawing.Size(637, 21); this.rbChangeQB.TabStop = true;
this.cbQBClasses.TabIndex = 11; 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 // FixPriceDifference
// //
this.AcceptButton = this.btnOK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.btnCancel; this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(637, 403); this.ClientSize = new System.Drawing.Size(637, 403);
this.Controls.Add(this.cbQBClasses); this.Controls.Add(this.groupBox1);
this.Controls.Add(this.lblStatus);
this.Controls.Add(this.lblTitle);
this.Controls.Add(this.btnOK); this.Controls.Add(this.btnOK);
this.Controls.Add(this.btnCancel); this.Controls.Add(this.btnCancel);
this.Controls.Add(this.lblTitle);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "FixPriceDifference"; this.Name = "FixPriceDifference";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; 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.Load += new System.EventHandler(this.SetQBClass_load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
@@ -113,7 +163,10 @@
private System.Windows.Forms.Button btnOK; private System.Windows.Forms.Button btnOK;
private System.Windows.Forms.Button btnCancel; private System.Windows.Forms.Button btnCancel;
private System.Windows.Forms.Label lblTitle; private System.Windows.Forms.Label lblTitle;
private System.Windows.Forms.Label lblStatus; private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.ComboBox cbQBClasses; private System.Windows.Forms.RadioButton rbChangeQB;
private System.Windows.Forms.RadioButton rbChangeAya;
private System.Windows.Forms.RadioButton rbQBOnce;
private System.Windows.Forms.RadioButton rbAyaOnce;
} }
} }

View File

@@ -12,29 +12,22 @@ namespace AyaNovaQBI
} }
public string DialogTitle { get; set; }
public string OptionTitle { get; set; } public string OptionTitle { get; set; }
public string OptionDescription { get; set; }
public string SelectedResolution { get; set; } = "AYAONCE";
public DataTable QBClasses { get; set; }
public string SelectedQBClass { get; set; }
private void SetQBClass_load(object sender, EventArgs e) private void SetQBClass_load(object sender, EventArgs e)
{ {
Text = DialogTitle;
lblDescription.Text = OptionDescription;
lblTitle.Text = OptionTitle; lblTitle.Text = OptionTitle;
btnCancel.Text = util.AyaTranslations["Cancel"]; btnCancel.Text = util.AyaTranslations["Cancel"];
btnOK.Text = util.AyaTranslations["OK"]; 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; DialogResult = DialogResult.OK;
Close(); 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();
}
} }
} }