DataEntry.Standard entry form remembers serial numbers. These can be loaded from a drop-down., version = 1.3.19
This commit is contained in:
@@ -52,6 +52,16 @@ namespace TBF.BenchControl.DataEntry.Standard
|
||||
|
||||
PrepareOrderCombo(orderComboBox);
|
||||
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (WaterMetersCount >= 1) comboBox1.Items.Add(Program.LocalSettings.LastSNTexts[0]);
|
||||
if (WaterMetersCount >= 2) comboBox2.Items.Add(Program.LocalSettings.LastSNTexts[1]);
|
||||
if (WaterMetersCount >= 3) comboBox3.Items.Add(Program.LocalSettings.LastSNTexts[2]);
|
||||
if (WaterMetersCount >= 4) comboBox4.Items.Add(Program.LocalSettings.LastSNTexts[3]);
|
||||
if (WaterMetersCount >= 5) comboBox5.Items.Add(Program.LocalSettings.LastSNTexts[4]);
|
||||
if (WaterMetersCount >= 6) comboBox6.Items.Add(Program.LocalSettings.LastSNTexts[5]);
|
||||
}
|
||||
|
||||
if (WaterMetersCount < 1) groupBox1.Visible = false;
|
||||
if (WaterMetersCount < 2) groupBox2.Visible = false;
|
||||
if (WaterMetersCount < 3) groupBox3.Visible = false;
|
||||
@@ -106,46 +116,155 @@ namespace TBF.BenchControl.DataEntry.Standard
|
||||
#endif
|
||||
);
|
||||
|
||||
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; }
|
||||
if (WaterMetersCount >= 4) { SNText[3] = textBox4.Text; Disabled[3] = !checkBox4.Checked; }
|
||||
if (WaterMetersCount >= 5) { SNText[4] = textBox5.Text; Disabled[4] = !checkBox5.Checked; }
|
||||
if (WaterMetersCount >= 6) { SNText[5] = textBox6.Text; Disabled[5] = !checkBox6.Checked; }
|
||||
Program.LocalSettings.LastSNTexts = SNText;
|
||||
|
||||
if (WaterMetersCount >= 1) { SNText[0] = comboBox1.Text; Disabled[0] = !checkBox1.Checked; }
|
||||
if (WaterMetersCount >= 2) { SNText[1] = comboBox2.Text; Disabled[1] = !checkBox2.Checked; }
|
||||
if (WaterMetersCount >= 3) { SNText[2] = comboBox3.Text; Disabled[2] = !checkBox3.Checked; }
|
||||
if (WaterMetersCount >= 4) { SNText[3] = comboBox4.Text; Disabled[3] = !checkBox4.Checked; }
|
||||
if (WaterMetersCount >= 5) { SNText[4] = comboBox5.Text; Disabled[4] = !checkBox5.Checked; }
|
||||
if (WaterMetersCount >= 6) { SNText[5] = comboBox6.Text; Disabled[5] = !checkBox6.Checked; }
|
||||
|
||||
completed = true;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void textBox1_TextChanged(object sender, EventArgs e)
|
||||
|
||||
private void UpdateAllCombos()
|
||||
{
|
||||
if (WaterMetersCount >= 1)
|
||||
{
|
||||
comboBox1.Text = Program.LocalSettings.LastSNTexts[0];
|
||||
checkBox1.Checked = !string.IsNullOrEmpty(comboBox1.Text);
|
||||
}
|
||||
if (WaterMetersCount >= 2)
|
||||
{
|
||||
comboBox2.Text = Program.LocalSettings.LastSNTexts[1];
|
||||
checkBox2.Checked = !string.IsNullOrEmpty(comboBox2.Text);
|
||||
}
|
||||
if (WaterMetersCount >= 3)
|
||||
{
|
||||
comboBox3.Text = Program.LocalSettings.LastSNTexts[2];
|
||||
checkBox3.Checked = !string.IsNullOrEmpty(comboBox3.Text);
|
||||
}
|
||||
if (WaterMetersCount >= 4)
|
||||
{
|
||||
comboBox4.Text = Program.LocalSettings.LastSNTexts[3];
|
||||
checkBox4.Checked = !string.IsNullOrEmpty(comboBox4.Text);
|
||||
}
|
||||
if (WaterMetersCount >= 5)
|
||||
{
|
||||
comboBox5.Text = Program.LocalSettings.LastSNTexts[4];
|
||||
checkBox5.Checked = !string.IsNullOrEmpty(comboBox5.Text);
|
||||
}
|
||||
if (WaterMetersCount >= 6)
|
||||
{
|
||||
comboBox6.Text = Program.LocalSettings.LastSNTexts[5];
|
||||
checkBox6.Checked = !string.IsNullOrEmpty(comboBox6.Text);
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
checkBox1.Checked = true;
|
||||
}
|
||||
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox1.Text.Equals(Program.LocalSettings.LastSNTexts[0]))
|
||||
{
|
||||
UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void textBox2_TextChanged(object sender, EventArgs e)
|
||||
|
||||
private void comboBox2_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
checkBox2.Checked = true;
|
||||
}
|
||||
private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox2.Text.Equals(Program.LocalSettings.LastSNTexts[1]))
|
||||
{
|
||||
UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void textBox3_TextChanged(object sender, EventArgs e)
|
||||
private void comboBox3_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
checkBox3.Checked = true;
|
||||
}
|
||||
private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox3.Text.Equals(Program.LocalSettings.LastSNTexts[2]))
|
||||
{
|
||||
UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void textBox4_TextChanged(object sender, EventArgs e)
|
||||
private void comboBox4_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
checkBox4.Checked = true;
|
||||
}
|
||||
|
||||
private void textBox5_TextChanged(object sender, EventArgs e)
|
||||
private void comboBox4_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox4.Text.Equals(Program.LocalSettings.LastSNTexts[3]))
|
||||
{
|
||||
UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void comboBox5_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
checkBox5.Checked = true;
|
||||
}
|
||||
private void comboBox5_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox5.Text.Equals(Program.LocalSettings.LastSNTexts[4]))
|
||||
{
|
||||
UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void textBox6_TextChanged(object sender, EventArgs e)
|
||||
private void comboBox6_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
checkBox6.Checked = true;
|
||||
}
|
||||
private void comboBox6_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Program.LocalSettings.LastSNTextsCount == WaterMetersCount)
|
||||
{
|
||||
if (comboBox6.Text.Equals(Program.LocalSettings.LastSNTexts[5]))
|
||||
{
|
||||
UpdateAllCombos();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void clearButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (WaterMetersCount >= 1) { comboBox1.Text = string.Empty; checkBox1.Checked = false; }
|
||||
if (WaterMetersCount >= 2) { comboBox2.Text = string.Empty; checkBox2.Checked = false; }
|
||||
if (WaterMetersCount >= 3) { comboBox3.Text = string.Empty; checkBox3.Checked = false; }
|
||||
if (WaterMetersCount >= 4) { comboBox4.Text = string.Empty; checkBox4.Checked = false; }
|
||||
if (WaterMetersCount >= 5) { comboBox5.Text = string.Empty; checkBox5.Checked = false; }
|
||||
if (WaterMetersCount >= 6) { comboBox6.Text = string.Empty; checkBox6.Checked = false; }
|
||||
}
|
||||
|
||||
|
||||
#region Forced close handling
|
||||
|
||||
@@ -165,5 +284,5 @@ namespace TBF.BenchControl.DataEntry.Standard
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user