Purchase order history in Local settings
This commit is contained in:
@@ -37,15 +37,11 @@ namespace TBF.BenchControl.DataEntry.Standard
|
||||
Height = 147 + WaterMetersCount * 90;
|
||||
}
|
||||
|
||||
/// <summary> Parameterless constructor for 3 watermeters </summary>
|
||||
public CycleBeginningForm()
|
||||
: this(3)
|
||||
{
|
||||
}
|
||||
|
||||
private void CycleBeginningForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
|
||||
PrepareOrderCombo(orderComboBox);
|
||||
|
||||
if (WaterMetersCount < 1) groupBox1.Visible = false;
|
||||
if (WaterMetersCount < 2) groupBox2.Visible = false;
|
||||
@@ -58,6 +54,7 @@ namespace TBF.BenchControl.DataEntry.Standard
|
||||
void Localize()
|
||||
{
|
||||
Text = Strings.Data;
|
||||
orderGroupBox.Text = Strings.Purchase_Order;
|
||||
groupBox1.Text = Strings.Water_Meter + " 1";
|
||||
groupBox2.Text = Strings.Water_Meter + " 2";
|
||||
groupBox3.Text = Strings.Water_Meter + " 3";
|
||||
@@ -73,9 +70,28 @@ namespace TBF.BenchControl.DataEntry.Standard
|
||||
okButton.Text = Strings.OkBtnText;
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
/// <summary>
|
||||
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
|
||||
/// </summary>
|
||||
/// <param name="orderComboBox">Puchase order ComboBox</param>
|
||||
void PrepareOrderCombo(ComboBox orderComboBox)
|
||||
{
|
||||
for (int i = 0; i < Program.LocalSettings.PurchaseOrderHistoryCount; i++)
|
||||
{
|
||||
orderComboBox.Items.Add(Program.LocalSettings.PurchaseOrderHistory[i]);
|
||||
}
|
||||
|
||||
if (orderComboBox.Items.Count > 0)
|
||||
{
|
||||
orderComboBox.Text = orderComboBox.Items[0].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
PurchaseOrder = orderComboBox.Text;
|
||||
Program.LocalSettings.UpdatePurchaseOrderHistory(orderComboBox.Text);
|
||||
|
||||
if (WaterMetersCount >= 1) { SNText[0] = textBox1.Text; Disabled[0] = !checkBox1.Checked; }
|
||||
if (WaterMetersCount >= 2) { SNText[1] = textBox2.Text; Disabled[1] = !checkBox2.Checked; }
|
||||
if (WaterMetersCount >= 3) { SNText[2] = textBox3.Text; Disabled[2] = !checkBox3.Checked; }
|
||||
|
||||
Reference in New Issue
Block a user