Hi,
Something needs to be wrong but I cannot see what. Please help.
Erp.Tables.ShipHead ShipHead;
Erp.Tables.MasterPack MasterPack;
Erp.Tables.MasterPackDtl MasterPackDtl;
var _ttMasterPack = (from P in ttMasterPack where (P.Added() || P.Updated()) select P);
if(_ttMasterPack != null)
{
foreach(var ttMasterPack_Row in _ttMasterPack)
{
if(ttMasterPack_Row.TrackingNumber != string.Empty)
{
string trackingNumber = ttMasterPack_Row.TrackingNumber;
PublishInfoMessage(trackingNumber,Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual,"",""); //this display the tracking number and nothing else is happening SIC! No other pop-ups.
var _DtlPackNumbers = (from P in ttMasterPackDtl where P.PackNum == ttMasterPack_Row.PackNum select P);
if(_DtlPackNumbers != null)
{
foreach(var DtlPackNumRow in _DtlPackNumbers)
{
PublishInfoMessage("DtlPackNum",Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual,"","");
using (var txScope = IceContext.CreateDefaultTransactionScope())
{
var ShipHeadRow = (from P in Db.ShipHead where P.PackNum == DtlPackNumRow.DtlPackNum select P).FirstOrDefault();
ShipHeadRow.TrackingNumber = trackingNumber;
PublishInfoMessage("Saved to database",Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual,"","");
Db.Validate();
txScope.Complete();
}
}
}
else
{
PublishInfoMessage("NoPacks in dataset",Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual,"","");
var _DtlPackNumbersDB = (from P in Db.MasterPackDtl where P.PackNum == ttMasterPack_Row.PackNum select P);
if(_DtlPackNumbersDB != null)
{
foreach(var DtlPackNumRow in _DtlPackNumbersDB)
{
PublishInfoMessage("DtlPackNum from DB",Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual,"","");
using (var txScope = IceContext.CreateDefaultTransactionScope())
{
var ShipHeadRow = (from P in Db.ShipHead where P.PackNum == DtlPackNumRow.DtlPackNum select P).FirstOrDefault();
ShipHeadRow.TrackingNumber = trackingNumber;
PublishInfoMessage("Saved to database",Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual,"","");
Db.Validate();
txScope.Complete();
}
}
}
else{ this.PublishInfoMessage("NoPacks in database",Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual,"",""); }
}
}
}
}
Thank you
Regards
Aleksander