コード例 #1
0
        protected void MakeDifferentialDocument(WarehouseDocument document)
        {
            WarehouseDocument whDoc = (WarehouseDocument)this.coordinator.CreateNewBusinessObject(BusinessObjectType.WarehouseDocument,
                                                                                                  document.Source.Attribute("template").Value, new XElement(document.Source));

            document.SetAlternateVersion(whDoc);
            document.UpdateStatus(true);

            List <WarehouseDocumentLine> linesToDelete = new List <WarehouseDocumentLine>();

            foreach (WarehouseDocumentLine line in document.Lines.Children)
            {
                if (line.Status != BusinessObjectStatus.Modified)
                {
                    linesToDelete.Add(line);
                }
                else
                {
                    //sprawdzamy czy nie jest to korekta na plus
                    if (line.Quantity > ((WarehouseDocumentLine)line.AlternateVersion).Quantity)
                    {
                        throw new ClientException(ClientExceptionId.QuantityOnCorrectionAboveZero);
                    }
                }
            }

            foreach (WarehouseDocumentLine line in linesToDelete)
            {
                document.Lines.Children.Remove(line);
            }

            if (whDoc.InitialCorrectedDocument != null)
            {
                document.InitialCorrectedDocument = whDoc.InitialCorrectedDocument;
            }
        }
コード例 #2
0
        public XDocument SaveBusinessObject(WarehouseDocument shiftDocument)
        {
            DictionaryMapper.Instance.CheckForChanges();

            this.CorrectDocumentConsistency(shiftDocument);

            shiftDocument.Validate();

            //WarehouseDocument document = (WarehouseDocument)this.coordinator.CreateNewBusinessObject(BusinessObjectType.WarehouseDocument, "outcomeShift", null);
            //document.Deserialize(shiftDocument.Serialize());
            //zmienione bo shiftTransaction sie nie przenosilo
            WarehouseDocument document = (WarehouseDocument)mapper.ConvertToBusinessObject(shiftDocument.FullXml.Root.Element("warehouseDocument"), shiftDocument.FullXml.Root.Element("options"));

            if (document.IsNew) //jezeli to edycja to nie ruszamy linii
            {
                document.Lines.RemoveAll();
            }

            SqlConnectionManager.Instance.BeginTransaction();

            try
            {
                DictionaryMapper.Instance.CheckForChanges();
                this.mapper.CheckBusinessObjectVersion(document);

                if (document.IsNew) //jezeli to edycja to nie ruszamy linii
                {
                    this.GenerateLines(shiftDocument, document);
                }

                this.ExecuteDocumentOptions(document);

                document.Validate();

                //load alternate version
                if (!document.IsNew)
                {
                    IBusinessObject alternateBusinessObject = this.mapper.LoadBusinessObject(document.BOType, document.Id.Value);
                    document.SetAlternateVersion(alternateBusinessObject);
                }

                DocumentLogicHelper.AssignNumber(document, this.mapper);

                document.UpdateStatus(true);

                if (document.AlternateVersion != null)
                {
                    document.AlternateVersion.UpdateStatus(false);
                }

                this.coordinator.UpdateStock(document);

                this.ValidateShiftsToLinesRelations(document);

                if (document.DocumentStatus == DocumentStatus.Canceled && ConfigurationMapper.Instance.IsWmsEnabled)
                {
                    DependencyContainerManager.Container.Get <WarehouseMapper>().DeleteShiftsForDocument(document.Id.Value);
                }

                XDocument operations = XDocument.Parse("<root/>");

                document.SaveChanges(operations);

                if (document.AlternateVersion != null)
                {
                    document.AlternateVersion.SaveChanges(operations);
                }

                document.SaveRelations(operations);

                if (document.AlternateVersion != null)
                {
                    ((WarehouseDocument)document.AlternateVersion).SaveRelations(operations);
                }

                if (operations.Root.HasElements)
                {
                    //this.mapper.UpdateStockForCanceledDocument(document);
                    this.mapper.ExecuteOperations(operations);

                    if (document.IsNew)
                    {
                        this.mapper.ValuateOutcomeWarehouseDocument(document);
                    }

                    this.mapper.CreateCommunicationXml(document);
                    this.mapper.CreateCommunicationXmlForDocumentRelations(operations);
                    this.mapper.UpdateDictionaryIndex(document);
                }

                //MM- może realizować rezerwację
                this.mapper.UpdateReservationAndOrderStock(document);

                WarehouseCoordinator.ProcessWarehouseManagamentSystem(document.ShiftTransaction);

                Coordinator.LogSaveBusinessObjectOperation();

                this.ProcessLocalOutcomeShift(document);

                if (document.DraftId != null)
                {
                    this.mapper.DeleteDraft(document.DraftId.Value);
                }

                XDocument returnXml = XDocument.Parse(String.Format(CultureInfo.InvariantCulture, "<root><id>{0}</id></root>", shiftDocument.Id.Value.ToUpperString()));

                //Custom validation
                this.mapper.ExecuteOnCommitValidationCustomProcedure(document);

                if (this.coordinator.CanCommitTransaction)
                {
                    if (!ConfigurationMapper.Instance.ForceRollbackTransaction)
                    {
                        SqlConnectionManager.Instance.CommitTransaction();
                    }
                    else
                    {
                        SqlConnectionManager.Instance.RollbackTransaction();
                    }
                }

                return(returnXml);
            }
            catch (SqlException sqle)
            {
                RoboFramework.Tools.RandomLogHelper.GetLog().Debug("FractusRefactorTraceCatch:78");
                Coordinator.ProcessSqlException(sqle, document.BOType, this.coordinator.CanCommitTransaction);
                throw;
            }
            catch (Exception)
            {
                RoboFramework.Tools.RandomLogHelper.GetLog().Debug("FractusRefactorTraceCatch:79");
                if (this.coordinator.CanCommitTransaction)
                {
                    SqlConnectionManager.Instance.RollbackTransaction();
                }
                throw;
            }
        }
コード例 #3
0
        public override XDocument SaveBusinessObject(WarehouseDocument document)
        {
            DictionaryMapper.Instance.CheckForChanges();

            this.DeliverySelectionCheck(document);

            //validate
            document.Validate();

            //load alternate version
            if (!document.IsNew)
            {
                IBusinessObject alternateBusinessObject = this.mapper.LoadBusinessObject(document.BOType, document.Id.Value);
                document.SetAlternateVersion(alternateBusinessObject);
            }

            this.ProcessShiftOrder(document);

            //update status
            document.UpdateStatus(true);

            if (document.AlternateVersion != null)
            {
                document.AlternateVersion.UpdateStatus(false);
            }

            SqlConnectionManager.Instance.BeginTransaction();

            try
            {
                DictionaryMapper.Instance.CheckForChanges();
                this.mapper.CheckBusinessObjectVersion(document);

                if (document.DocumentStatus == DocumentStatus.Canceled && ConfigurationMapper.Instance.IsWmsEnabled)
                {
                    DependencyContainerManager.Container.Get <WarehouseMapper>().DeleteShiftsForDocument(document.Id.Value);
                }

                if (document.DocumentType.WarehouseDocumentOptions.UpdateLastPurchasePrice)
                {
                    UpdateLastPurchasePriceRequest updateLastPurchasePriceRequest = new UpdateLastPurchasePriceRequest(document);
                    this.mapper.UpdateStock(updateLastPurchasePriceRequest);
                }

                //Make operations list
                XDocument operations = XDocument.Parse("<root/>");

                document.SaveChanges(operations);

                if (document.AlternateVersion != null)
                {
                    document.AlternateVersion.SaveChanges(operations);
                }

                if (operations.Root.HasElements)
                {
                    this.coordinator.UpdateStock(document);
                    //this.mapper.UpdateStockForCanceledDocument(document);

                    this.mapper.ExecuteOperations(operations);

                    this.mapper.CreateCommunicationXml(document);
                    this.mapper.CreateCommunicationXmlForDocumentRelations(operations);
                    this.mapper.UpdateDictionaryIndex(document);
                }

                Coordinator.LogSaveBusinessObjectOperation();

                document.SaveRelatedObjects();

                operations = XDocument.Parse("<root/>");

                document.SaveRelations(operations);

                if (document.AlternateVersion != null)
                {
                    ((WarehouseDocument)document.AlternateVersion).SaveRelations(operations);
                }

                if (operations.Root.HasElements)
                {
                    this.mapper.ExecuteOperations(operations);
                    this.mapper.CreateCommunicationXmlForDocumentRelations(operations); //generowanie paczek dla relacji dokumentow
                }

                this.mapper.ValuateIncomeWarehouseDocument(document, false);

                this.ProcessLocalIncomeShift(document);

                XDocument returnXml = XDocument.Parse(String.Format(CultureInfo.InvariantCulture, "<root><id>{0}</id></root>", document.Id.ToUpperString()));

                //Custom validation
                this.mapper.ExecuteOnCommitValidationCustomProcedure(document);

                if (this.coordinator.CanCommitTransaction)
                {
                    if (!ConfigurationMapper.Instance.ForceRollbackTransaction)
                    {
                        SqlConnectionManager.Instance.CommitTransaction();
                    }
                    else
                    {
                        SqlConnectionManager.Instance.RollbackTransaction();
                    }
                }

                return(returnXml);
            }
            catch (SqlException sqle)
            {
                RoboFramework.Tools.RandomLogHelper.GetLog().Debug("FractusRefactorTraceCatch:69");
                Coordinator.ProcessSqlException(sqle, document.BOType, this.coordinator.CanCommitTransaction);
                throw;
            }
            catch (Exception)
            {
                RoboFramework.Tools.RandomLogHelper.GetLog().Debug("FractusRefactorTraceCatch:70");
                if (this.coordinator.CanCommitTransaction)
                {
                    SqlConnectionManager.Instance.RollbackTransaction();
                }
                throw;
            }
        }
コード例 #4
0
        /// <summary>
        /// Saves the business object.
        /// </summary>
        /// <param name="document"><see cref="WarehouseDocument"/> to save.</param>
        /// <returns>Xml containing result of oper</returns>
        public XDocument SaveBusinessObject(WarehouseDocument document)
        {
            DictionaryMapper.Instance.CheckForChanges();

            //correct the document that comes from client
            this.CorrectDocumentConsistency(document);

            this.ExecuteDocumentOptions(document);

            //validate
            document.Validate();

            //Walidacja zmian w dokumencie realizującym zamówienie sprzedażowe
            document.CheckDoesRealizeClosedSalesOrder(coordinator);

            //load alternate version
            if (!document.IsNew)
            {
                IBusinessObject alternateBusinessObject = this.mapper.LoadBusinessObject(document.BOType, document.Id.Value);
                document.SetAlternateVersion(alternateBusinessObject);
            }

            //update status
            document.UpdateStatus(true);

            if (document.AlternateVersion != null)
            {
                document.AlternateVersion.UpdateStatus(false);
            }

            SqlConnectionManager.Instance.BeginTransaction();

            try
            {
                DictionaryMapper.Instance.CheckForChanges();
                this.mapper.CheckBusinessObjectVersion(document);

                //logika dla automatycznego zamykania ZS w realizacji bezzaliczkowej
                this.coordinator.TryCloseSalesOrdersWhileRealization(document);

                this.coordinator.UpdateStock(document);

                this.ValidationDuringTransaction(document);

                if (document.DocumentStatus == DocumentStatus.Canceled && ConfigurationMapper.Instance.IsWmsEnabled)
                {
                    DependencyContainerManager.Container.Get <WarehouseMapper>().DeleteShiftsForDocument(document.Id.Value);
                }

                if (!document.IsNew && document.DocumentStatus == DocumentStatus.Committed)
                {
                    this.mapper.DeleteIncomeOutcomeRelations(document);
                }

                if (document.DocumentStatus == DocumentStatus.Committed)
                {
                    this.ProcessIncomeOutcome(document);
                }

                DocumentLogicHelper.AssignNumber(document, this.mapper);

                //Make operations list
                XDocument operations = XDocument.Parse("<root/>");

                document.SaveChanges(operations);

                if (document.AlternateVersion != null)
                {
                    document.AlternateVersion.SaveChanges(operations);
                }

                if (operations.Root.HasElements)
                {
                    // this.mapper.UpdateStockForCanceledDocument(document);
                    this.mapper.ExecuteOperations(operations);
                    this.mapper.ValuateOutcomeWarehouseDocument(document);
                    this.mapper.CreateCommunicationXml(document);
                    this.mapper.CreateCommunicationXmlForDocumentRelations(operations);
                    this.mapper.UpdateDictionaryIndex(document);
                }


                Coordinator.LogSaveBusinessObjectOperation();

                document.SaveRelatedObjects();

                operations = XDocument.Parse("<root/>");

                document.SaveRelations(operations);

                if (document.AlternateVersion != null)
                {
                    ((WarehouseDocument)document.AlternateVersion).SaveRelations(operations);
                }

                if (operations.Root.HasElements)
                {
                    this.mapper.ExecuteOperations(operations);
                    this.mapper.CreateCommunicationXmlForDocumentRelations(operations); //generowanie paczek dla relacji dokumentow
                }

                this.mapper.DeleteDocumentAccountingData(document);

                this.mapper.UpdateReservationAndOrderStock(document);

                WarehouseCoordinator.ProcessWarehouseManagamentSystem(document.ShiftTransaction);

                //Custom validation
                this.mapper.ExecuteOnCommitValidationCustomProcedure(document);
                Coordinator.LogSaveBusinessObjectOperation();

                if (document.DraftId != null)
                {
                    this.mapper.DeleteDraft(document.DraftId.Value);
                }

                XDocument returnXml = XDocument.Parse(String.Format(CultureInfo.InvariantCulture, "<root><id>{0}</id></root>", document.Id.ToUpperString()));

                if (this.coordinator.CanCommitTransaction)
                {
                    if (!ConfigurationMapper.Instance.ForceRollbackTransaction)
                    {
                        SqlConnectionManager.Instance.CommitTransaction();
                    }
                    else
                    {
                        SqlConnectionManager.Instance.RollbackTransaction();
                    }
                }

                return(returnXml);
            }
            catch (SqlException sqle)
            {
                RoboFramework.Tools.RandomLogHelper.GetLog().Debug("FractusRefactorTraceCatch:80");
                Coordinator.ProcessSqlException(sqle, document.BOType, this.coordinator.CanCommitTransaction);
                throw;
            }
            catch (Exception)
            {
                RoboFramework.Tools.RandomLogHelper.GetLog().Debug("FractusRefactorTraceCatch:81");
                if (this.coordinator.CanCommitTransaction)
                {
                    SqlConnectionManager.Instance.RollbackTransaction();
                }
                throw;
            }
        }
コード例 #5
0
        public XDocument ProcessWarehouseCorrectiveDocument(WarehouseDocument document)
        {
            SqlConnectionManager.Instance.BeginTransaction();

            try
            {
                DictionaryMapper.Instance.CheckForChanges();

                this.MakeDifferentialDocument(document);

                document.AlternateVersion = null;
                this.coordinator.UpdateStock(document);

                WarehouseDocument targetDocument = (WarehouseDocument)this.coordinator.CreateNewBusinessObject(BusinessObjectType.WarehouseDocument, document.Source.Attribute("template").Value, null);
                targetDocument.Contractor  = document.Contractor;
                targetDocument.WarehouseId = document.WarehouseId;
                DuplicableAttributeFactory.CopyAttributes(document, targetDocument);
                targetDocument.UpdateStatus(true);
                this.SaveDocumentHeaderAndAttributes(targetDocument);

                int       ordinalNumber = 0;
                XDocument xml           = null;
                XDocument operations    = XDocument.Parse("<root><incomeOutcomeRelation/><commercialWarehouseRelation/><commercialWarehouseValuation/></root>");

                foreach (WarehouseDocumentLine line in document.Lines.Children)
                {
                    Guid?commercialCorrectiveLineId = null;

                    if (line.CommercialCorrectiveLine != null)
                    {
                        commercialCorrectiveLineId = line.CommercialCorrectiveLine.Id;
                    }

                    xml           = this.mapper.CreateOutcomeQuantityCorrection(line.Id.Value, line.Version.Value, targetDocument.Id.Value, line.Quantity, ordinalNumber, commercialCorrectiveLineId);
                    ordinalNumber = Convert.ToInt32(xml.Root.Element("ordinalNumber").Value, CultureInfo.InvariantCulture);

                    if (xml.Root.Element("incomeOutcomeRelation") != null)
                    {
                        operations.Root.Element("incomeOutcomeRelation").Add(xml.Root.Element("incomeOutcomeRelation").Elements());
                    }

                    if (xml.Root.Element("commercialWarehouseRelation") != null)
                    {
                        operations.Root.Element("commercialWarehouseRelation").Add(xml.Root.Element("commercialWarehouseRelation").Elements());
                    }

                    if (xml.Root.Element("commercialWarehouseValuation") != null)
                    {
                        operations.Root.Element("commercialWarehouseValuation").Add(xml.Root.Element("commercialWarehouseValuation").Elements());
                    }
                }

                this.mapper.ValuateOutcomeWarehouseDocument(targetDocument);
                this.mapper.CreateCommunicationXml(targetDocument);
                this.mapper.CreateCommunicationXmlForDocumentRelations(operations);

                XDocument returnXml = XDocument.Parse(String.Format(CultureInfo.InvariantCulture, "<root><id>{0}</id></root>", targetDocument.Id.ToUpperString()));

                //Custom validation
                this.mapper.ExecuteOnCommitValidationCustomProcedure(targetDocument);

                if (this.coordinator.CanCommitTransaction)
                {
                    if (!ConfigurationMapper.Instance.ForceRollbackTransaction)
                    {
                        SqlConnectionManager.Instance.CommitTransaction();
                    }
                    else
                    {
                        SqlConnectionManager.Instance.RollbackTransaction();
                    }
                }

                return(returnXml);
            }
            catch (SqlException sqle)
            {
                RoboFramework.Tools.RandomLogHelper.GetLog().Debug("FractusRefactorTraceCatch:57");
                Coordinator.ProcessSqlException(sqle, document.BOType, this.coordinator.CanCommitTransaction);
                throw;
            }
            catch (Exception)
            {
                RoboFramework.Tools.RandomLogHelper.GetLog().Debug("FractusRefactorTraceCatch:58");
                if (this.coordinator.CanCommitTransaction)
                {
                    SqlConnectionManager.Instance.RollbackTransaction();
                }
                throw;
            }
        }
コード例 #6
0
        public XDocument ProcessWarehouseCorrectiveDocument(WarehouseDocument document)
        {
            SqlConnectionManager.Instance.BeginTransaction();

            try
            {
                DictionaryMapper.Instance.CheckForChanges();

                this.MakeDifferentialDocument(document);

                if (document.DocumentType.WarehouseDocumentOptions.UpdateLastPurchasePrice)
                {
                    UpdateLastPurchasePriceRequest updateLastPurchasePriceRequest = new UpdateLastPurchasePriceRequest(document);
                    this.mapper.UpdateStock(updateLastPurchasePriceRequest);
                }

                //sprawdzamy czy nie zmniejszylismy gdzies ilosci ponizej ilosci ktora zostala juz rozchodowana
                bool outcomeCorrectionNeeded = this.CheckForQuantityBelowRelated(document);

                document.AlternateVersion = null;
                this.coordinator.UpdateStock(document);

                WarehouseDocument incomeCorrection = (WarehouseDocument)this.coordinator.CreateNewBusinessObject(BusinessObjectType.WarehouseDocument, document.Source.Attribute("template").Value, null);
                incomeCorrection.Contractor  = document.Contractor;
                incomeCorrection.WarehouseId = document.WarehouseId;
                DuplicableAttributeFactory.CopyAttributes(document, incomeCorrection);
                incomeCorrection.UpdateStatus(true);
                this.SaveDocumentHeaderAndAttributes(incomeCorrection);

                WarehouseDocument outcomeCorrection = null;
                int? outcomeCorrectionOrdinalNumber = null;
                Guid?outcomeCorrectionHeaderId      = null;

                if (outcomeCorrectionNeeded)
                {
                    DocumentType dt       = incomeCorrection.DocumentType;
                    string       template = dt.WarehouseDocumentOptions.AutomaticCostCorrectionTemplate;

                    if (String.IsNullOrEmpty(template))
                    {
                        throw new InvalidOperationException("automaticCostCorrectionTemplate is not set for the document type: " + dt.Symbol);
                    }

                    outcomeCorrection             = (WarehouseDocument)this.coordinator.CreateNewBusinessObject(BusinessObjectType.WarehouseDocument, template, null);
                    outcomeCorrection.WarehouseId = document.WarehouseId;
                    outcomeCorrection.UpdateStatus(true);
                    this.SaveDocumentHeaderAndAttributes(outcomeCorrection);
                    outcomeCorrectionOrdinalNumber = 0;
                    outcomeCorrectionHeaderId      = outcomeCorrection.Id.Value;
                }

                int       incomeCorrectionOrdinalNumber = 0;
                XDocument xml        = null;
                XDocument operations = XDocument.Parse("<root><incomeOutcomeRelation/><commercialWarehouseRelation/><commercialWarehouseValuation/></root>");

                foreach (WarehouseDocumentLine line in document.Lines.Children)
                {
                    Guid?commercialCorrectiveLineId = null;

                    if (line.CommercialCorrectiveLine != null)
                    {
                        commercialCorrectiveLineId = line.CommercialCorrectiveLine.Id;
                    }

                    xml = this.mapper.CreateIncomeQuantityCorrection(line.Id.Value, line.Version.Value, incomeCorrection.Id.Value,
                                                                     outcomeCorrectionHeaderId, line.Quantity, line.Value, line.IncomeDate.Value, incomeCorrectionOrdinalNumber,
                                                                     outcomeCorrectionOrdinalNumber, commercialCorrectiveLineId);

                    //Prowizorka umieszczona w celu wychwycenia trudnego do zlokalizowania błędu - przerzucam komunikat od Czarka w wyjątku
                    if (!xml.Root.HasElements)
                    {
                        throw new ClientException(ClientExceptionId.ForwardError, null
                                                  , String.Format("message:{0}", xml.Root.Value));
                    }

                    incomeCorrectionOrdinalNumber = Convert.ToInt32(xml.Root.Element("incomeOrdinalNumber").Value, CultureInfo.InvariantCulture);

                    if (outcomeCorrectionOrdinalNumber != null)
                    {
                        outcomeCorrectionOrdinalNumber = Convert.ToInt32(xml.Root.Element("outcomeOrdinalNumber").Value, CultureInfo.InvariantCulture);
                    }

                    if (xml.Root.Element("incomeOutcomeRelation") != null)
                    {
                        operations.Root.Element("incomeOutcomeRelation").Add(xml.Root.Element("incomeOutcomeRelation").Elements());
                    }

                    if (xml.Root.Element("commercialWarehouseRelation") != null)
                    {
                        operations.Root.Element("commercialWarehouseRelation").Add(xml.Root.Element("commercialWarehouseRelation").Elements());
                    }

                    if (xml.Root.Element("commercialWarehouseValuation") != null)
                    {
                        operations.Root.Element("commercialWarehouseValuation").Add(xml.Root.Element("commercialWarehouseValuation").Elements());
                    }
                }

                if (ConfigurationMapper.Instance.IsWmsEnabled &&
                    DictionaryMapper.Instance.GetWarehouse(incomeCorrection.WarehouseId).ValuationMethod == ValuationMethod.DeliverySelection)
                {
                    using (WarehouseCoordinator whC = new WarehouseCoordinator(false, false))
                    {
                        ShiftTransaction st = (ShiftTransaction)whC.CreateNewBusinessObject(BusinessObjectType.ShiftTransaction, null, null);
                        st.UpdateStatus(true);
                        XDocument shiftTransactionOperations = XDocument.Parse("<root/>");
                        st.SaveChanges(shiftTransactionOperations);
                        this.mapper.ExecuteOperations(shiftTransactionOperations);
                        this.mapper.CreateShiftCorrection(incomeCorrection.Id.Value, st.Id.Value);
                    }
                }

                if (outcomeCorrection != null)
                {
                    this.mapper.ValuateOutcomeWarehouseDocument(outcomeCorrection);
                }

                this.mapper.CreateCommunicationXml(incomeCorrection);

                if (outcomeCorrection != null)
                {
                    this.mapper.CreateCommunicationXml(outcomeCorrection);
                }

                this.mapper.CreateCommunicationXmlForDocumentRelations(operations);

                XDocument returnXml = XDocument.Parse(String.Format(CultureInfo.InvariantCulture, "<root><id>{0}</id></root>", incomeCorrection.Id.ToUpperString()));

                //Custom validation
                this.mapper.ExecuteOnCommitValidationCustomProcedure(incomeCorrection);
                if (outcomeCorrection != null)
                {
                    this.mapper.ExecuteOnCommitValidationCustomProcedure(outcomeCorrection);
                }

                if (this.coordinator.CanCommitTransaction)
                {
                    if (!ConfigurationMapper.Instance.ForceRollbackTransaction)
                    {
                        SqlConnectionManager.Instance.CommitTransaction();
                    }
                    else
                    {
                        SqlConnectionManager.Instance.RollbackTransaction();
                    }
                }

                return(returnXml);
            }
            catch (SqlException sqle)
            {
                RoboFramework.Tools.RandomLogHelper.GetLog().Debug("FractusRefactorTraceCatch:55");
                Coordinator.ProcessSqlException(sqle, document.BOType, this.coordinator.CanCommitTransaction);
                throw;
            }
            catch (Exception)
            {
                RoboFramework.Tools.RandomLogHelper.GetLog().Debug("FractusRefactorTraceCatch:56");
                if (this.coordinator.CanCommitTransaction)
                {
                    SqlConnectionManager.Instance.RollbackTransaction();
                }
                throw;
            }
        }