Bug fixes: LocalSettings.UpdateHistory, DataEntry.Standard.EntryForm

This commit is contained in:
Milan Hanajik
2015-06-10 18:33:43 +02:00
parent ea9a4a3953
commit 8fff9e86c5
2 changed files with 8 additions and 8 deletions
@@ -195,15 +195,15 @@ namespace TBF.BenchControl.DataEntry.Standard
else if (currentOp == CurrentOp.ShowFormAtCycleEnd)
{
CycleEndForm dlg = (modelessDlg as CycleEndForm);
if (dlg != null)
int count = waterMeters.Count;
if ((dlg != null) && (count > dlg.WaterMetersCount)) count = dlg.WaterMetersCount;
for (int i = 0; i < count; i++)
{
for (int i = 0; i < Math.Min(dlg.WaterMetersCount, waterMeters.Count); i++)
if (waterMeters[i] != null)
{
if (waterMeters[i] != null)
{
/// In case entryFormCfg.ShowCycleEndForm == false dlg would be null, values would be string.Empty
wmCycleEndState[i] = waterMeters[i].EndState = (dlg != null) ? dlg.EndStateText[i] : string.Empty;
}
/// In case entryFormCfg.ShowCycleEndForm == false dlg would be null, values would be string.Empty
wmCycleEndState[i] = waterMeters[i].EndState = (dlg != null) ? dlg.EndStateText[i] : string.Empty;
}
}
}
+1 -1
View File
@@ -238,7 +238,7 @@ namespace TBF
if (match >= 0 || currentHistoryCount >= maxHistoryLen)
{
/// History does not have to be (because of a match) or should not be extended (because of the lenght)
if (match < 0) match = PurchaseOrderHistoryCount - 1;
if (match < 0) match = currentHistoryCount - 1;
for (int j = match; j > 0; j--)
{