public static RMAOutBoundManager GetInstance() { if (_instance == null) { _instance = new RMAOutBoundManager(); } return(_instance); }
public static RMAOutBoundManager GetInstance() { if (_instance == null) { _instance = new RMAOutBoundManager(); } return _instance; }
public void Create(RMAOutBoundInfo oParam) { TransactionOptions options = new TransactionOptions(); options.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; options.Timeout = TransactionManager.DefaultTimeout; using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, options)) { oParam.SysNo = SequenceDac.GetInstance().Create("RMA_OutBound_Sequence"); oParam.OutBoundID = getOutBoundID(oParam.SysNo); new RMAOutBoundDac().InsertMaster(oParam); int OutBoundInvoiceQty = 0; foreach (int registerSysNo in oParam.itemHash.Keys) { object item = oParam.itemHash[registerSysNo]; this.InsertItem(oParam.SysNo, registerSysNo); Hashtable htRegister = new Hashtable(); htRegister.Add("SysNo", registerSysNo); htRegister.Add("OutBoundWithInvoice", Util.TrimIntNull(item.ToString())); RMARegisterManager.GetInstance().UpdateRegister(htRegister); if (Util.TrimIntNull(item.ToString()) == (int)AppEnum.OutBoundWithInvoice.SendWithInvoice) { OutBoundInvoiceQty = OutBoundInvoiceQty + 1; } else { OutBoundInvoiceQty = OutBoundInvoiceQty + 0; } } Hashtable htOutBound = new Hashtable(); htOutBound.Add("SysNo", oParam.SysNo); htOutBound.Add("OutBoundInvoiceQty", OutBoundInvoiceQty); RMAOutBoundManager.GetInstance().UpdateMaster(htOutBound); scope.Complete(); } }