(1) power users obtain nr.6 on startup, (2) maxBatchNr from DB detected and used, (3) more logging, ver. 2.4.258.

This commit is contained in:
Milan Hanajik
2016-04-07 13:52:57 +02:00
parent a275a911f6
commit 2d20ea1196
5 changed files with 160 additions and 90 deletions
+17
View File
@@ -182,6 +182,23 @@ namespace Results
WaterMeterDataList = session.CreateQuery("FROM WaterMeterData").List<Entities.WaterMeterData>();
}
/// <summary>
/// Loads shared data from the database
/// </summary>
/// <exception>Throws NHibernate exceptions</exception>
public static int GetMaxSavedBatchNr()
{
ISession session = DB.CreateSession();
IList<Entities.Batch> batches = session.CreateQuery("FROM Batch").List<Entities.Batch>();
int maxBatchNr = 0;
foreach (var b in batches)
{
if (b.BatchNr > maxBatchNr) maxBatchNr = b.BatchNr;
}
return maxBatchNr;
}
/// <summary>
/// Update TestData, Components and WaterMeterData fo tests and water meters in batch results