DataEntry.iPerl bug fixes when invoked without the production tracing, ver. 3.1.1846
This commit is contained in:
@@ -240,14 +240,20 @@ namespace TBF.Rig.Output.DB.ProductionTracing
|
||||
return null;
|
||||
}
|
||||
|
||||
public IList<OrderInfo> ReadOrders(ISession session)
|
||||
public IList<OrderInfo> ReadOrders(ISession session = null)
|
||||
{
|
||||
bool openAndCloseSession = (session == null) || !session.IsOpen;
|
||||
|
||||
try
|
||||
{
|
||||
session = SessionFactory.OpenSession();
|
||||
if (openAndCloseSession) session = SessionFactory.OpenSession();
|
||||
|
||||
var result = session.QueryOver<OrderInfo>()
|
||||
.Where(x => (x.POState == (sbyte)OrderState.New || x.POState == (sbyte)OrderState.Active))
|
||||
.List<OrderInfo>();
|
||||
|
||||
if (openAndCloseSession) session.Close();
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (Exception exc)
|
||||
@@ -266,8 +272,8 @@ namespace TBF.Rig.Output.DB.ProductionTracing
|
||||
if (openAndCloseSession) session = SessionFactory.OpenSession();
|
||||
|
||||
var list = session.QueryOver<OrderInfo>()
|
||||
.Where(x => (x.Id == order.Id))
|
||||
.List();
|
||||
.Where(x => (x.Id == order.Id))
|
||||
.List();
|
||||
|
||||
if (openAndCloseSession) session.Close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user