Esempio n. 1
0
        public void GetTransactionResult(ref List<TransactionResult> result)
        {
            if ((this.hasNoLogStatus))
                return;
            TransactionResult transactionResult;

            transactionResult = new TransactionResult();

            transactionResult.EntityName = this.DocumentName;
            transactionResult.Action = LogstateToTransactionAction(this.LogState);
            transactionResult.CRMID = this.CrmId;
            transactionResult.ID = this.Id;
            transactionResult.Status = this.status;
            transactionResult.Message = this.message;

            if(transactionResult.CRMID != null)
                result.Add(transactionResult);

            foreach (DocumentCollection coll in this.collections.Values)
                coll.GetTransactionResult(ref result);
        }
Esempio n. 2
0
        /// <summary>
        /// of following entities:
        /// •	Account
        /// •	Order
        /// </summary>
        /// <param name="EntityName"></param>
        /// <param name="TransactionData"></param>
        /// <param name="config"></param>
        /// <returns></returns>
        public TransactionResult[] ExecuteTransactions(string EntityName, Transaction[] TransactionData, NorthwindConfig config)
        {
            int seqenceID;
            try
            {

                EntityBase entity = EntityFactory.GetEntity(EntityName);

                if (entity == null)
                    throw new Exception(string.Format(Resources.ErrorMessages_OperationNotImplementedForEntity, EntityName));

                seqenceID = config.SequenceNumber;
                return entity.ExecuteTransactions(TransactionData, config);
            }

            catch (Exception e)
            {

                TransactionResult[] results = new TransactionResult[1];

                results[0] = new TransactionResult();
                results[0].Status = TransactionStatus.FatalError;
                results[0].EntityName = EntityName;
                results[0].Message = e.ToString();

                return results;

            }
        }
Esempio n. 3
0
        public TransactionResult GetTransactionResult()
        {
            TransactionResult transactionResult;

            transactionResult = new TransactionResult();

            transactionResult.EntityName = this.DocumentName;
            transactionResult.Action = LogstateToTransactionAction(this.LogState);
            transactionResult.CRMID = this.CrmId;
            transactionResult.ID = this.Id;
            transactionResult.Status = this.status;
            transactionResult.Message = this.message;

            return transactionResult;
        }