예제 #1
0
        /// <summary>
        /// Insert the specified <paramref name="maintainable"/> as dataflow if <paramref name="maintainable"/> is final.
        /// </summary>
        /// <param name="state">
        /// The state.
        /// </param>
        /// <param name="maintainable">
        /// The <see cref="IDataStructureObject"/>.
        /// </param>
        /// <param name="artefactStatus">
        /// The artefact status.
        /// </param>
        /// <remarks>
        /// This method inserts the specified data structure object (DSD) as dataflow. It is not an error.
        /// </remarks>
        private void InsertAsDataflow(DbTransactionState state, IDataStructureObject maintainable, ArtefactImportStatus artefactStatus)
        {
            if (maintainable.IsFinal.IsTrue)
            {
                var dataflowStoredProcedure = new StoredProcedures().InsertDataflow;

                var artefactFinalStatus = GetFinalStatus(state, new StructureReferenceImpl(maintainable.AsReference, SdmxStructureEnumType.Dataflow));
                if (artefactFinalStatus.IsEmpty)
                {
                    this.InsertArtefactInternal(
                        state,
                        maintainable,
                        dataflowStoredProcedure,
                        command =>
                    {
                        dataflowStoredProcedure.CreateDsdIdParameter(command).Value = artefactStatus.PrimaryKeyValue;
                        dataflowStoredProcedure.CreateMapSetIdParameter(command);
                    });
                }
            }
        }