From 5fc58c1574844f8124570425ddb9a4f58ebd4d94 Mon Sep 17 00:00:00 2001 From: luanhui <1029149336@qq.com> Date: Wed, 11 Apr 2018 20:56:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E6=B1=82=E5=8D=95No.139460?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs b/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs index e8ac7dd..7a3a610 100644 --- a/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs +++ b/B3QingDaoWanFu/TypeIOCs/SaleOutStoreBLTypeIoc.cs @@ -25,6 +25,18 @@ namespace BWP.B3QingDaoWanFu.TypeIOCs { detail.FactoryPrice = GetFactoryPrice(context, dmo, detail.SaleGoods_ID); } + + var query=new DmoQuery(typeof(SaleGoods_Accounting_Store)); + query.Where.Conditions.Add(DQCondition.EQ("AccountingUnit_ID",dmo.AccountingUnit_ID)); + query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("SaleGoods_ID"),dmo.Details.Select(x=>DQExpression.Value(x.SaleGoods_ID)).ToArray())); + var list = context.Session.ExecuteList(query).Cast().ToList(); + foreach (SaleGoods_Accounting_Store storeset in list) + { + if (storeset.Store_ID != dmo.Store_ID) + { + throw new Exception(storeset.SaleGoods_Name+"配置的仓库:"+storeset.Store_Name+" 与单据上的仓库不一致,不允许保存"); + } + } } private Money? GetFactoryPrice(IDmoContext context, SaleOutStore dmo, long detailSaleGoodsId)