/// <summary> /// Fill cross sectional levels. /// </summary> /// <param name="component"> /// The component. /// </param> /// <param name="storedProcedure"> /// The stored Procedure. /// </param> /// <param name="command"> /// The command. /// </param> private static void SetCrossSectionalLevels(IComponent component, InsertComponent storedProcedure, DbCommand command) { DbParameter xsAttlevelDsParameter = storedProcedure.CreateXsAttlevelDsParameter(command); DbParameter xsAttlevelGroupParameter = storedProcedure.CreateXsAttlevelGroupParameter(command); DbParameter xsAttlevelSectionParameter = storedProcedure.CreateXsAttlevelSectionParameter(command); DbParameter xsAttlevelObsParameter = storedProcedure.CreateXsAttlevelObsParameter(command); var crossDsd = component.MaintainableParent as ICrossSectionalDataStructureObject; if (crossDsd != null) { if (crossDsd.GetCrossSectionalAttachDataSet(false, component.StructureType).Contains(component)) { xsAttlevelDsParameter.Value = TrueValue; } if (crossDsd.GetCrossSectionalAttachGroup(false, component.StructureType).Contains(component)) { xsAttlevelGroupParameter.Value = TrueValue; } if (crossDsd.GetCrossSectionalAttachSection(false, component.StructureType).Contains(component)) { xsAttlevelSectionParameter.Value = TrueValue; } if (crossDsd.GetCrossSectionalAttachObservation(component.StructureType).Contains(component)) { xsAttlevelObsParameter.Value = TrueValue; } } }
/// <summary> /// Set codelist parameters. /// </summary> /// <param name="storedProcedure"> /// The stored procedure. /// </param> /// <param name="command"> /// The command. /// </param> /// <param name="codelistStatus"> /// The codelist status. /// </param> /// <param name="component"> /// The component. /// </param> private static void SetCodelist(InsertComponent storedProcedure, DbCommand command, ItemSchemeFinalStatus codelistStatus, IComponent component) { DbParameter clidParameter = storedProcedure.CreateClIdParameter(command); DbParameter conSchIdParameter = storedProcedure.CreateConSchIdParameter(command); if (codelistStatus != null && component.HasCodedRepresentation()) { switch (component.Representation.Representation.TargetReference.EnumType) { case SdmxStructureEnumType.CodeList: clidParameter.Value = codelistStatus.FinalStatus.PrimaryKey; break; case SdmxStructureEnumType.ConceptScheme: { var crossDsd = component.MaintainableParent as ICrossSectionalDataStructureObject; if (crossDsd != null) { clidParameter.Value = codelistStatus.FinalStatus.PrimaryKey; } else { conSchIdParameter.Value = codelistStatus.FinalStatus.PrimaryKey; } } break; } } }
/// <summary> /// Set parent DataStructure definition. /// </summary> /// <param name="parentArtefact"> /// The parent artefact. /// </param> /// <param name="storedProcedure"> /// The stored procedure. /// </param> /// <param name="command"> /// The command. /// </param> private static void SetDsd(long parentArtefact, InsertComponent storedProcedure, DbCommand command) { DbParameter dsdIdParameter = storedProcedure.CreateDsdIdParameter(command); dsdIdParameter.Value = parentArtefact; }
/// <summary> /// Set concept parameter. /// </summary> /// <param name="storedProcedure"> /// The stored procedure. /// </param> /// <param name="command"> /// The command. /// </param> /// <param name="conceptID"> /// The concept id. /// </param> private static void SetConcept(InsertComponent storedProcedure, DbCommand command, ItemStatus conceptID) { DbParameter conIdParameter = storedProcedure.CreateConIdParameter(command); conIdParameter.Value = conceptID.SysID; }
/// <summary> /// Set component type parameter. /// </summary> /// <param name="component"> /// The component. /// </param> /// <param name="storedProcedure"> /// The stored procedure. /// </param> /// <param name="command"> /// The command. /// </param> private static void SetComponentType(IComponent component, InsertComponent storedProcedure, DbCommand command) { DbParameter typeParameter = storedProcedure.CreateTypeParameter(command); typeParameter.Value = component.GetMappingStoreType(); }