Beispiel #1
0
        public bool ProcessTransaction(ISnApi objSn, ISoApi objSo, IParamApi objParam)
        {
            var r        = false;
            var nextcode = objSn.ValidateNextCode();

            if (nextcode != objSn.RouteDetail.next_pass)
            {
                OnTransactionProceed(objSn.ReturnMsg);
            }
            _engageId = ProcessEngage(objSn, objSo, nextcode);
            if (_engageId > 0)
            {
                _transId = ProcessTransaction(objSn, _engageId, true);
                if (_transId > 0)
                {
                    r = true;
                    if (objParam != null)
                    {
                        _paramId = ProcessParam(objSn, objParam, _engageId);
                        if (_paramId < 0)
                        {
                            r = false;
                        }
                    }
                }
            }
            if (!r)
            {
                RollBackTransaction(objSn, objSo, objParam, null);
            }
            return(r);
        }
Beispiel #2
0
        public bool ProcessTransactionFail(ISnApi objSn, IParamApi objParam, IFailureApi objFailure)
        {
            var r = false;

            _transId = ProcessTransaction(objSn, objSn.SnDetail.id, false);
            if (_transId > 0)
            {
                var nextcode = objSn.ValidateNextCode();
                if (nextcode != objSn.RouteDetail.next_pass)
                {
                    OnTransactionProceed(objSn.ReturnMsg);
                }
                var performId = ProcessEngageUpdate(objSn, nextcode);
                if (performId > 0)
                {
                    r = true;
                    if (objParam != null)
                    {
                        var pId = ProcessParam(objSn, objParam, performId);
                        if (pId < 0)
                        {
                            r = false;
                        }
                    }
                }
            }
            if (!r)
            {
                RollBackTransaction(objSn, null, objParam, objFailure);
            }
            return(r);
        }