public void AddItemRelated(int sysno, int freightUserSysNo, DLItemInfo dlItem, int DLItemType, int updateUser) { TransactionOptions options = new TransactionOptions(); options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; options.Timeout = TransactionManager.DefaultTimeout; using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options)) { Hashtable ht = new Hashtable(); ht.Add("SysNo", sysno); ht.Add("FreightUserSysNo", freightUserSysNo); ht.Add("SetDeliveryManTime", DateTime.Now); ht.Add("DLSysNo", dlItem.DLSysNo); if (DLItemType == (int)AppEnum.DLItemType.SaleOrder) { SaleManager.GetInstance().UpdateSOMaster(ht); } else if (DLItemType == (int)AppEnum.DLItemType.RMARequest) { RMARequestManager.GetInstance().SetDeliveryMen(ht); } else if (DLItemType == (int)AppEnum.DLItemType.RMARevert) { RMARevertManager.GetInstance().SetDeliveryMen(ht); } else if (DLItemType == (int)AppEnum.DLItemType.RMAOutbound) { RMAOutBoundManager.GetInstance().SetDeliveryMen(ht); } else if (DLItemType == (int)AppEnum.DLItemType.RMASendAccessory) { RMASendAccessoryManager.GetInstance().SetDeliveryMen(ht); } else if (DLItemType == (int)AppEnum.DLItemType.StShift) { ShiftManager.GetInstance().UpdateShiftMaster(ht); } DeliveryManSetListInfo oInfo = new DeliveryManSetListInfo(); oInfo.ItemID = dlItem.ItemID; oInfo.SetUserSysNo = updateUser; oInfo.FreightUserSysNo = freightUserSysNo; oInfo.CreateTime = DateTime.Now; oInfo.DLSysNo = dlItem.DLSysNo; DeliveryManager.GetInstance().InsertDeliveryMenSetList(oInfo); DLManager.GetInstance().AddNewDLItem(dlItem); scope.Complete(); } }
public void ChangeFreight(DLInfo oDLMasterInfo) { TransactionOptions options = new TransactionOptions(); options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; options.Timeout = TransactionManager.DefaultTimeout; using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options)) { //更新DL主表信息 UpdateDLMaster(oDLMasterInfo); DLInfo oDLInfo = Load(oDLMasterInfo.SysNo); //更新各单据配送人信息 DeliveryManSetListInfo deliveryInfo = new DeliveryManSetListInfo(); deliveryInfo.SetUserSysNo = oDLMasterInfo.UpdateFreightManUserSysNo; deliveryInfo.FreightUserSysNo = oDLMasterInfo.FreightUserSysNo; deliveryInfo.CreateTime = DateTime.Now; deliveryInfo.DLSysNo = oDLMasterInfo.SysNo; foreach (DLItemInfo oItem in oDLInfo.ItemHash.Values) { if (oItem.ItemType == (int)AppEnum.DLItemType.SaleOrder) { Hashtable ht = new Hashtable(); ht.Add("freightusersysno", oDLMasterInfo.FreightUserSysNo); ht.Add("SetDeliveryManTime", System.DateTime.Now); ht.Add("DLSysNo", oDLMasterInfo.SysNo); ht.Add("SysNo", Int32.Parse(oItem.ItemID.Substring(1))); SaleManager.GetInstance().UpdateSOMaster(ht); } else if (oItem.ItemType == (int)AppEnum.DLItemType.RMARequest) { Hashtable ht = new Hashtable(); ht.Add("freightusersysno", oDLMasterInfo.FreightUserSysNo); ht.Add("SetDeliveryManTime", System.DateTime.Now); ht.Add("DLSysNo", oDLMasterInfo.SysNo); ht.Add("SysNo", Int32.Parse(oItem.ItemID.Substring(2))); RMARequestManager.GetInstance().SetDeliveryMen(ht); } else if (oItem.ItemType == (int)AppEnum.DLItemType.RMARevert) { Hashtable ht = new Hashtable(); ht.Add("freightusersysno", oDLMasterInfo.FreightUserSysNo); ht.Add("SetDeliveryManTime", System.DateTime.Now); ht.Add("DLSysNo", oDLMasterInfo.SysNo); ht.Add("SysNo", Int32.Parse(oItem.ItemID.Substring(2))); RMARevertManager.GetInstance().SetDeliveryMen(ht); } else if (oItem.ItemType == (int)AppEnum.DLItemType.RMAOutbound) { Hashtable ht = new Hashtable(); ht.Add("freightusersysno", oDLMasterInfo.FreightUserSysNo); ht.Add("SetDeliveryManTime", System.DateTime.Now); ht.Add("DLSysNo", oDLMasterInfo.SysNo); ht.Add("SysNo", Int32.Parse(oItem.ItemID.Substring(2))); RMAOutBoundManager.GetInstance().SetDeliveryMen(ht); } else if (oItem.ItemType == (int)AppEnum.DLItemType.RMASendAccessory) { Hashtable ht = new Hashtable(); ht.Add("freightusersysno", oDLMasterInfo.FreightUserSysNo); ht.Add("SetDeliveryManTime", System.DateTime.Now); ht.Add("DLSysNo", oDLMasterInfo.SysNo); ht.Add("SysNo", Int32.Parse(oItem.ItemID.Substring(2))); RMASendAccessoryManager.GetInstance().SetDeliveryMen(ht); } deliveryInfo.ItemID = oItem.ItemID; DeliveryManager.GetInstance().InsertDeliveryMenSetList(deliveryInfo); } scope.Complete(); } }