(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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user