DataEntry.iPerl bug fixes when invoked without the production tracing, ver. 3.1.1846
This commit is contained in:
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("3.1.1845.0")]
|
||||
[assembly: AssemblyFileVersion("3.1.1845.0")]
|
||||
[assembly: AssemblyVersion("3.1.1846.0")]
|
||||
[assembly: AssemblyFileVersion("3.1.1846.0")]
|
||||
|
||||
@@ -78,11 +78,11 @@ namespace TBF.Rig.DataEntry.iPerl
|
||||
foreach (var o in list) listOfOrders.Add(o);
|
||||
}
|
||||
|
||||
if ((cfg.Orders == Orders.FromTracingDB || cfg.Orders == Orders.CombinedAndFromTracingDB) && ProcessData.TracingDB != null)
|
||||
if ((cfg.Orders == Orders.FromTracingDB || cfg.Orders == Orders.CombinedAndFromTracingDB) &&
|
||||
ProcessData.TracingDB != null &&
|
||||
ProcessData.TracingDB.DebugLevel == DebugMode.Normal)
|
||||
{
|
||||
ISession session = ProcessData.TracingDB.SessionFactory.OpenSession();
|
||||
var list = ProcessData.TracingDB.ReadOrders(session);
|
||||
if (session.IsOpen) session.Close();
|
||||
var list = ProcessData.TracingDB.ReadOrders();
|
||||
foreach (var o in list) listOfOrders.Add(o);
|
||||
}
|
||||
|
||||
|
||||
@@ -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