|
|
|
@ -4,10 +4,13 @@ using BWP.B3SheepButcherManage.BO; |
|
|
|
using Forks.EnterpriseServices; |
|
|
|
using Forks.EnterpriseServices.BusinessInterfaces; |
|
|
|
using Forks.EnterpriseServices.DomainObjects2; |
|
|
|
using Forks.EnterpriseServices.DomainObjects2.DQuery; |
|
|
|
using Forks.EnterpriseServices.SqlDoms; |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text; |
|
|
|
using TSingSoft.WebPluginFramework; |
|
|
|
|
|
|
|
namespace BWP.B3SheepButcherManage.BL |
|
|
|
{ |
|
|
|
@ -53,9 +56,18 @@ namespace BWP.B3SheepButcherManage.BL |
|
|
|
|
|
|
|
protected override void doNullify(HurryButcher dmo) |
|
|
|
{ |
|
|
|
if (dmo.Details.Any()) |
|
|
|
throw new Exception("单据有急宰明细,不允许作废"); |
|
|
|
CheckHasDetail(dmo); |
|
|
|
base.doNullify(dmo); |
|
|
|
} |
|
|
|
|
|
|
|
void CheckHasDetail(HurryButcher dmo) |
|
|
|
{ |
|
|
|
var query = new DQueryDom(new JoinAlias(typeof(HurryButcher_Detail))); |
|
|
|
query.Where.Conditions.Add(DQCondition.EQ("HurryButcher_ID", dmo.ID)); |
|
|
|
query.Columns.Add(DQSelectColumn.Create(DQExpression.Value(1), "c")); |
|
|
|
query.Range = SelectRange.Top(1); |
|
|
|
if (query.EExecuteScalar(Session) != null) |
|
|
|
throw new Exception("单据有急宰明细,不允许作废"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |