Tester added to Print Order dialog, used in printout. TODO: Chinese
This commit is contained in:
+30
-5
@@ -32,13 +32,16 @@
|
||||
this.purchaseOrderGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.printButton = new System.Windows.Forms.Button();
|
||||
this.cancelButton = new System.Windows.Forms.Button();
|
||||
this.testerGroupBox = new System.Windows.Forms.GroupBox();
|
||||
this.testerComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.purchaseOrderGroupBox.SuspendLayout();
|
||||
this.testerGroupBox.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// purchaseOrderComboBox
|
||||
//
|
||||
this.purchaseOrderComboBox.FormattingEnabled = true;
|
||||
this.purchaseOrderComboBox.Location = new System.Drawing.Point(47, 47);
|
||||
this.purchaseOrderComboBox.Location = new System.Drawing.Point(47, 41);
|
||||
this.purchaseOrderComboBox.Name = "purchaseOrderComboBox";
|
||||
this.purchaseOrderComboBox.Size = new System.Drawing.Size(380, 31);
|
||||
this.purchaseOrderComboBox.TabIndex = 0;
|
||||
@@ -48,14 +51,14 @@
|
||||
this.purchaseOrderGroupBox.Controls.Add(this.purchaseOrderComboBox);
|
||||
this.purchaseOrderGroupBox.Location = new System.Drawing.Point(59, 38);
|
||||
this.purchaseOrderGroupBox.Name = "purchaseOrderGroupBox";
|
||||
this.purchaseOrderGroupBox.Size = new System.Drawing.Size(481, 114);
|
||||
this.purchaseOrderGroupBox.Size = new System.Drawing.Size(481, 96);
|
||||
this.purchaseOrderGroupBox.TabIndex = 1;
|
||||
this.purchaseOrderGroupBox.TabStop = false;
|
||||
this.purchaseOrderGroupBox.Text = "Purchase order";
|
||||
//
|
||||
// printButton
|
||||
//
|
||||
this.printButton.Location = new System.Drawing.Point(106, 204);
|
||||
this.printButton.Location = new System.Drawing.Point(106, 269);
|
||||
this.printButton.Name = "printButton";
|
||||
this.printButton.Size = new System.Drawing.Size(144, 64);
|
||||
this.printButton.TabIndex = 2;
|
||||
@@ -65,7 +68,7 @@
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.Location = new System.Drawing.Point(342, 204);
|
||||
this.cancelButton.Location = new System.Drawing.Point(342, 269);
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.Size = new System.Drawing.Size(144, 64);
|
||||
this.cancelButton.TabIndex = 3;
|
||||
@@ -73,11 +76,30 @@
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
|
||||
//
|
||||
// testerGroupBox
|
||||
//
|
||||
this.testerGroupBox.Controls.Add(this.testerComboBox);
|
||||
this.testerGroupBox.Location = new System.Drawing.Point(58, 142);
|
||||
this.testerGroupBox.Name = "testerGroupBox";
|
||||
this.testerGroupBox.Size = new System.Drawing.Size(481, 96);
|
||||
this.testerGroupBox.TabIndex = 4;
|
||||
this.testerGroupBox.TabStop = false;
|
||||
this.testerGroupBox.Text = "Tester";
|
||||
//
|
||||
// testerComboBox
|
||||
//
|
||||
this.testerComboBox.FormattingEnabled = true;
|
||||
this.testerComboBox.Location = new System.Drawing.Point(47, 41);
|
||||
this.testerComboBox.Name = "testerComboBox";
|
||||
this.testerComboBox.Size = new System.Drawing.Size(380, 31);
|
||||
this.testerComboBox.TabIndex = 0;
|
||||
//
|
||||
// PrintOrderForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 23F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(597, 323);
|
||||
this.ClientSize = new System.Drawing.Size(597, 380);
|
||||
this.Controls.Add(this.testerGroupBox);
|
||||
this.Controls.Add(this.cancelButton);
|
||||
this.Controls.Add(this.printButton);
|
||||
this.Controls.Add(this.purchaseOrderGroupBox);
|
||||
@@ -91,6 +113,7 @@
|
||||
this.Text = "Print watermeter results";
|
||||
this.Load += new System.EventHandler(this.PrintOrderForm_Load);
|
||||
this.purchaseOrderGroupBox.ResumeLayout(false);
|
||||
this.testerGroupBox.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@@ -101,5 +124,7 @@
|
||||
private System.Windows.Forms.GroupBox purchaseOrderGroupBox;
|
||||
private System.Windows.Forms.Button printButton;
|
||||
private System.Windows.Forms.Button cancelButton;
|
||||
private System.Windows.Forms.GroupBox testerGroupBox;
|
||||
private System.Windows.Forms.ComboBox testerComboBox;
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ namespace TBF.Forms
|
||||
public partial class PrintOrderForm : Form
|
||||
{
|
||||
public string PurchaseOrder;
|
||||
public string Tester;
|
||||
|
||||
public PrintOrderForm()
|
||||
{
|
||||
@@ -25,6 +26,7 @@ namespace TBF.Forms
|
||||
Top = (ls.PrintOrderTop != 0) ? ls.PrintOrderTop : 100;
|
||||
|
||||
PrepareOrderCombo(purchaseOrderComboBox);
|
||||
PrepareTesterCombo(testerComboBox);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -37,20 +39,44 @@ namespace TBF.Forms
|
||||
{
|
||||
orderComboBox.Items.Add(Program.LocalSettings.PurchaseOrderHistory[i]);
|
||||
}
|
||||
|
||||
if (orderComboBox.Items.Count > 0)
|
||||
{
|
||||
orderComboBox.Text = orderComboBox.Items[0].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
|
||||
/// </summary>
|
||||
/// <param name="orderComboBox">Puchase order ComboBox</param>
|
||||
void PrepareTesterCombo(ComboBox testerComboBox)
|
||||
{
|
||||
for (int i = 0; i < Program.LocalSettings.TesterHistoryCount; i++)
|
||||
{
|
||||
testerComboBox.Items.Add(Program.LocalSettings.TesterHistory[i]);
|
||||
}
|
||||
if (testerComboBox.Items.Count > 0)
|
||||
{
|
||||
testerComboBox.Text = testerComboBox.Items[0].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void printButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
PurchaseOrder = purchaseOrderComboBox.Text;
|
||||
Tester = testerComboBox.Text;
|
||||
|
||||
Program.LocalSettings.PrintOrderLeft = Location.X;
|
||||
Program.LocalSettings.PrintOrderTop = Location.Y;
|
||||
if (!Program.LocalSettings.UpdatePurchaseOrderHistory(purchaseOrderComboBox.Text))
|
||||
bool b1 = Program.LocalSettings.UpdateHistory(testerComboBox.Text,
|
||||
ref Program.LocalSettings.TesterHistory);
|
||||
bool b2 = Program.LocalSettings.UpdateHistory(purchaseOrderComboBox.Text,
|
||||
ref Program.LocalSettings.PurchaseOrderHistory
|
||||
#if FUZHOU150 || FUZHOU300
|
||||
, 20
|
||||
#endif
|
||||
);
|
||||
if (!b1 && !b2)
|
||||
{
|
||||
Program.LocalSettings.Save();
|
||||
}
|
||||
@@ -62,6 +88,7 @@ namespace TBF.Forms
|
||||
private void cancelButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
PurchaseOrder = string.Empty;
|
||||
Tester = string.Empty;
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user