/// <summary> /// retrieves the codelist Contrain of Dimension from database /// </summary> /// <param name="DataflowCode">Dataflow Code</param> /// <param name="dimension">Instance of Dimension "DimensionConcept"</param> /// <returns>list of Mutable Code Object</returns> public List <ICodeMutableObject> GetDimensionCodelistContrain(string DataflowCode, IDimensionConcept dimension) { try { if (dimension.DimensionType == DimensionTypeEnum.Time) { return(new List <ICodeMutableObject>()); } if (dimension.DimensionType == DimensionTypeEnum.Frequency) { if (dimension.IsFakeFrequency) { SpecialCodelistsManager sp = new SpecialCodelistsManager(this.parsingObject, this.versionTypeResp); return(sp.GetFrequencyCodelist(DataflowCode)); } else { return(InternalGetDimensionCodelistConstrain(DataflowCode, dimension.RealNameFreq)); } } return(InternalGetDimensionCodelistConstrain(DataflowCode, dimension.ConceptObjectCode)); } catch (SdmxException) { throw; } catch (Exception ex) { throw new SdmxException(this, FlyExceptionObject.FlyExceptionTypeEnum.CreateICodeMutableObject, ex); } }
/// <summary> /// retrieves the codelist Contrain of Dimension from database /// </summary> /// <param name="dimension">Instance of Dimension "DimensionConcept"</param> /// <returns>list of Mutable Code Object</returns> public List <ICodeMutableObject> GetDimensionCodelistNoContrain(IDimensionConcept dimension) { try { if (this.DbAccess.CheckExistStoreProcedure(DBOperationEnum.GetDimensionCodelistNOConstrain)) { if (dimension.DimensionType == DimensionTypeEnum.Time) { return(new List <ICodeMutableObject>()); } if (dimension.DimensionType == DimensionTypeEnum.Frequency) { if (dimension.IsFakeFrequency) { SpecialCodelistsManager sp = new SpecialCodelistsManager(this.parsingObject, this.versionTypeResp); return(sp.GetFrequencyCodelist()); } else { return(InternalGetDimensionCodelistNOConstrain(dimension.CodelistCode)); } } return(InternalGetDimensionCodelistNOConstrain(dimension.CodelistCode)); } else { if (FlyConfiguration.CodelistWhitoutConstrain) { IDataflowsManager dfMan = new MetadataFactory().InstanceDataflowsManager(this.parsingObject.CloneForReferences(), this.versionTypeResp); List <ICodeMutableObject> listCode = new List <ICodeMutableObject>(); var _foundedDataflow = dfMan.GetDataFlows(); List <SdmxObjectNameDescription> nomiDf = new List <SdmxObjectNameDescription>(); foreach (var df in _foundedDataflow) { string dfCode = df.Id; DimensionManager dim = new DimensionManager(this.parsingObject, this.versionTypeResp); List <IDimensionConcept> conc = dim.GetDimensionConceptObjects(dfCode, out nomiDf); if (conc.Exists(c => c.Id == dimension.Id)) { foreach (ICodeMutableObject item in GetDimensionCodelistContrain(dfCode, conc.Find(c => c.Id == dimension.Id))) { if (!listCode.Exists(cl => cl.Id == item.Id)) { listCode.Add(item); } } } } return(listCode); } else { throw new SdmxException(this, FlyExceptionObject.FlyExceptionTypeEnum.CodelistContrainRequired); } } } catch (SdmxException) { throw; } catch (Exception ex) { throw new SdmxException(this, FlyExceptionObject.FlyExceptionTypeEnum.CreateICodeMutableObject, ex); } }