Esempio n. 1
0
        internal bool InsertPayment(out PaymentInfoInsertErrorType errorType)
        {
            errorType = PaymentInfoInsertErrorType.NoError;

            if (this.CheckHasLinkIDAndChannelID())
            {
                errorType = PaymentInfoInsertErrorType.RepeatLinkID;

                return(false);
            }

            try
            {
                businessProxy.Save(this.entity);
                return(true);
            }
            catch (Exception ex)
            {
                Exception innerEx = ex;

                while (innerEx.InnerException != null)
                {
                    innerEx = innerEx.InnerException;
                }

                if (innerEx is SqlException && ((SqlException)innerEx).Number == 2601)
                {
                    errorType = PaymentInfoInsertErrorType.RepeatLinkID;
                    return(false);
                }

                throw ex;
            }
        }
        public bool InsertPayment(SPSStatePaymentInfoEntity statePaymentInfoEntity, List <string> uniqueKeyNames, out PaymentInfoInsertErrorType errorType)
        {
            errorType = PaymentInfoInsertErrorType.NoError;

            SPSStatePaymentInfoEntity spPaymentInfoEntity = this.DataObjectsContainerIocID.SPSStatePaymentInfoDataObjectInstance.CheckChannleLinkIDIsExist(statePaymentInfoEntity.ChannelID.Value, statePaymentInfoEntity, uniqueKeyNames);

            if (spPaymentInfoEntity != null)
            {
                errorType = PaymentInfoInsertErrorType.RepeatLinkID;

                return(false);
            }

            this.DataObjectsContainerIocID.SPSStatePaymentInfoDataObjectInstance.Save(statePaymentInfoEntity);

            return(true);
        }