//private ORGModels _dbContext; //protected virtual ORGModels DbContext //{ // get // { // if (_dbContext == null) // _dbContext = new ORGModels(); // return _dbContext; // } //} public void SaveLocationAssigner(IMS_CB_KC kc, IMS_CB_RQ rq, IMS_WT_CWRW cwrw, IMS_VC_DJH djh) { IMS_CB_Container_Dal dalContainer = new IMS_CB_Container_Dal(); IMS_WT_CWRW_Dal dalTask = new IMS_WT_CWRW_Dal(); IMS_VC_DJH_Dal dalOrderData = new IMS_VC_DJH_Dal(); IMS_CB_Inventory_Dal dalInventory = new IMS_CB_Inventory_Dal(); if (dalInventory.Exists(string.Format(" RQBH == \"{0}\" ", rq.RQBH))) { throw new JsMiracleException("容器编号已在库存中,请重新输入容器编号"); } using (var tran = new TransactionScope()) { try { dalContainer.SaveOrUpdate(rq); dalInventory.SaveOrUpdate(kc); dalTask.SaveOrUpdate(cwrw); dalOrderData.SaveOrUpdate(djh); tran.Complete(); } catch (Exception ex) { throw new Exception("组盘失败", ex); } } }
//private ORGModels _dbContext; //protected virtual ORGModels DbContext //{ // get // { // if (_dbContext == null) // _dbContext = new ORGModels(); // return _dbContext; // } //} public void SaveLocationAssigner(IMS_CB_KC kc, IMS_CB_RQ rq, IMS_WT_CWRW cwrw, IMS_VC_DJH djh) { IMS_CB_Container_Dal dalContainer = new IMS_CB_Container_Dal(); IMS_WT_CWRW_Dal dalTask = new IMS_WT_CWRW_Dal(); IMS_VC_DJH_Dal dalOrderData = new IMS_VC_DJH_Dal(); IMS_CB_Inventory_Dal dalInventory = new IMS_CB_Inventory_Dal(); if (dalInventory.Exists(string.Format(" RQBH == \"{0}\" ", rq.RQBH))) throw new JsMiracleException("容器编号已在库存中,请重新输入容器编号"); using (var tran = new TransactionScope()) { try { dalContainer.SaveOrUpdate(rq); dalInventory.SaveOrUpdate(kc); dalTask.SaveOrUpdate(cwrw); dalOrderData.SaveOrUpdate(djh); tran.Complete(); } catch (Exception ex) { throw new Exception("组盘失败", ex); } } }