Esempio n. 1
0
        /// <summary>
        /// Create a ImmutableInstance of AgencySchema
        /// </summary>
        /// <param name="_AgencyObject">Agency Object</param>
        /// <param name="AgencyOrganisationNames">Agency Organisation Names (Get it from File Config)</param>
        /// <returns>IAgencyScheme</returns>
        public IAgencyScheme BuildAgencyScheme(IAgencyMutableObject _AgencyObject, List <SdmxObjectNameDescription> AgencyOrganisationNames)
        {
            try
            {
                IAgencyScheme defschema = AgencySchemeCore.CreateDefaultScheme();
                IAgencySchemeMutableObject mutabledefschema = defschema.MutableInstance;

                mutabledefschema.AgencyId = FlyConfiguration.MainAgencyId;
                mutabledefschema.Names.Clear();
                foreach (var item in AgencyOrganisationNames)
                {
                    mutabledefschema.AddName(item.Lingua, item.Name);
                }


                mutabledefschema.Items.Clear();
                mutabledefschema.AddItem(_AgencyObject);

                return(mutabledefschema.ImmutableInstance);
            }
            catch (SdmxException) { throw; }
            catch (Exception ex)
            {
                throw new SdmxException(this, FlyExceptionObject.FlyExceptionTypeEnum.CreateImmutable, ex);
            }
        }
        private void SetGeneralTab(IAgencyScheme agencyScheme)
        {
            txtDSDID.Text = agencyScheme.Id;
            txtAgenciesReadOnly.Text = agencyScheme.AgencyId;
            txtVersion.Text = agencyScheme.Version;
            chkIsFinal.Checked = agencyScheme.IsFinal.IsTrue;

            FileDownload31.ucID = agencyScheme.Id;
            FileDownload31.ucAgency = agencyScheme.AgencyId;
            FileDownload31.ucVersion = agencyScheme.Version;
            FileDownload31.ucArtefactType = "AgencyScheme";

            txtDSDURI.Text = (agencyScheme.Uri != null) ? agencyScheme.Uri.AbsoluteUri : string.Empty;
            txtDSDURN.Text = (agencyScheme.Urn != null) ? agencyScheme.Urn.AbsoluteUri : string.Empty;
            txtValidFrom.Text = (agencyScheme.StartDate != null) ? string.Format("{0}/{1}/{2}", agencyScheme.StartDate.Date.Value.Day.ToString(), agencyScheme.StartDate.Date.Value.Month.ToString(), agencyScheme.StartDate.Date.Value.Year.ToString()) : string.Empty;
            txtValidTo.Text = (agencyScheme.EndDate != null) ? string.Format("{0}/{1}/{2}", agencyScheme.EndDate.Date.Value.Day.ToString(), agencyScheme.EndDate.Date.Value.Month.ToString(), agencyScheme.EndDate.Date.Value.Year.ToString()) : string.Empty;
            txtDSDName.Text = _localizedUtils.GetNameableName(agencyScheme);
            txtDSDDescription.Text = _localizedUtils.GetNameableDescription(agencyScheme);

            // Svuoto le griglie name e description
            //===========================================
            if (AddTextName.TextObjectList != null && AddTextName.TextObjectList.Count != 0)
            {
                AddTextName.ClearTextObjectList();
            }
            if (AddTextDescription.TextObjectList != null && AddTextDescription.TextObjectList.Count != 0)
            {
                AddTextDescription.ClearTextObjectList();
            }

            txtDSDID.Enabled = false;
            txtVersion.Enabled = false;
            cmbAgencies.Enabled = false;

            if (_action == Action.VIEW || agencyScheme.IsFinal.IsTrue)
            {
                AddTextName.Visible = false;
                AddTextDescription.Visible = false;
                txtAllDescriptions.Visible = true;
                txtAllNames.Visible = true;
                chkIsFinal.Enabled = false;
                txtAllDescriptions.Text = _localizedUtils.GetNameableDescription(agencyScheme);
                txtAllNames.Text = _localizedUtils.GetNameableName(agencyScheme);
            }
            else
            {
                AspConfirmationExit = "true";

                AddTextName.Visible = true;
                AddTextDescription.Visible = true;
                txtAllDescriptions.Visible = false;
                txtAllNames.Visible = false;

                /*
                 * DA IMPLEMENTARE L'ADDING NELLE GRIDS DI MASSIMILIANO
                 */

                AddTextName.InitTextObjectList = agencyScheme.Names;
                AddTextDescription.InitTextObjectList = agencyScheme.Descriptions;
            }

            AnnotationGeneralControl.AddText_ucOpenTabName = AnnotationGeneralControl.ClientID;
            AnnotationGeneralControl.AnnotationObjectList = agencyScheme.MutableInstance.Annotations;
            AnnotationGeneralControl.EditMode = (agencyScheme.IsFinal.IsTrue || _action == Action.VIEW) ? false : true;
            AnnotationGeneralControl.OwnerAgency =  txtAgenciesReadOnly.Text;
            ctr_annotation_update.EditMode = (agencyScheme.IsFinal.IsTrue || _action == Action.VIEW) ? false : true;

            if (agencyScheme.IsFinal.IsTrue || _action == Action.VIEW)
            {
                txtValidFrom.Enabled = false;
                txtValidTo.Enabled = false;
                txtDSDName.Enabled = false;
                txtDSDDescription.Enabled = false;
                txtDSDURI.Enabled = false;
                chkIsFinal.Enabled = false;
            }
            else
            {
                txtValidFrom.Enabled = true;
                txtValidTo.Enabled = true;
                txtDSDName.Enabled = true;
                txtDSDDescription.Enabled = true;
                txtDSDURI.Enabled = true;
                //chkIsFinal.Enabled = true;
            }

            //===========================================

            if ( _action == Action.INSERT )
            {
                cmbAgencies.Visible = true;
                txtAgenciesReadOnly.Visible = false;
            }
            else
            {
                cmbAgencies.Visible = false;
                txtAgenciesReadOnly.Visible = true;
            }

            SetAgencyDetailPanel(agencyScheme);
        }
 private void SetAgencyDetailPanel(IAgencyScheme agencyScheme)
 {
     // Verifico se la codelist è final
     if (agencyScheme.IsFinal.IsTrue || _action == Action.VIEW)
     {
         // Se final il pulsante di add e le colonne di modifica
         // dei codici non devono apparire
         btnSaveMemoryAgencyScheme.Visible = false;
         btnAddNewAgency.Visible = false;
         AddTextName_Update.ucEditMode = false;
         AddTextDescription_Update.ucEditMode = false;
         AnnotationGeneralControl.EditMode = false;
         btnSaveAnnotationCode.Enabled = false;
         btnUpdateAgency.Enabled = false;
         //gvAgencyschemesItem.Columns[3].Visible = false;
         gvAgencyschemesItem.Columns[4].Visible = false;
         //gvAgencyschemesItem.Columns[5].Visible = false;
         cmbLanguageForCsv.Visible = false;
         imgImportCsv.Visible = false;
     }
     else
     {
         btnSaveMemoryAgencyScheme.Visible = true;
         btnAddNewAgency.Visible = true;
         gvAgencyschemesItem.Columns[3].Visible = true;
         gvAgencyschemesItem.Columns[4].Visible = true;
         gvAgencyschemesItem.Columns[5].Visible = true;
         Utils.PopulateCmbLanguages(cmbLanguageForCsv, AVAILABLE_MODES.MODE_FOR_ADD_TEXT);
         cmbLanguageForCsv.Visible = true;
         imgImportCsv.Visible = true;
     }
 }
        /// <summary>
        /// The build.
        /// </summary>
        /// <param name="agencySchemeBean">
        /// The agency scheme bean.
        /// </param>
        /// <returns>
        /// The <see cref="OrganisationSchemeType"/> .
        /// </returns>
        public OrganisationSchemeType Build(IAgencyScheme agencySchemeBean)
        {
            OrganisationSchemeType builtObj = this.GetOrganisationSchemeType(agencySchemeBean);
            if (agencySchemeBean.Items.Count > 0)
            {
                var type = new AgenciesType();
                builtObj.Agencies.Add(type);

                /* foreach */
                foreach (IAgency currentBean in agencySchemeBean.Items)
                {
                    type.Agency.Add(this._organisationRoleXmlBuilder.Build(currentBean));
                }
            }
            return builtObj;
        }
Esempio n. 5
0
		///////////////////////////////////////////////////////////////////////////////////////////////////
		////////////BUILD FROM V1 SCHEMA				 //////////////////////////////////////////////////
		///////////////////////////////////////////////////////////////////////////////////////////////////
		public AgencyCore(AgencyType bean, IAgencyScheme parent) {
		}
Esempio n. 6
0
		///////////////////////////////////////////////////////////////////////////////////////////////////
		////////////BUILD FROM V2 SCHEMA				 //////////////////////////////////////////////////
		///////////////////////////////////////////////////////////////////////////////////////////////////
		public AgencyCore(OrganisationType bean, IAgencyScheme parent) : base(bean, Org.Sdmxsource.Sdmx.Api.Constants.SdmxStructureType.GetFromEnum(SdmxStructureEnumType.AGENCY), bean.Id, bean.Uri, bean.NameList, bean.DescriptionList, bean.Annotations, parent) {
		}
Esempio n. 7
0
		///////////////////////////////////////////////////////////////////////////////////////////////////
		////////////BUILD FROM V2.1 SCHEMA				 //////////////////////////////////////////////////
		///////////////////////////////////////////////////////////////////////////////////////////////////
		public AgencyCore(
				Org.Sdmx.Resources.SdmxMl.Schemas.V21.Structure.AgencyType type,
				IAgencyScheme parent) : base(bean, Org.Sdmxsource.Sdmx.Api.Constants.SdmxStructureType.GetFromEnum(SdmxStructureEnumType.AGENCY), bean.Id, bean.Uri, bean.NameList, null, null, parent) {
		}
Esempio n. 8
0
		///////////////////////////////////////////////////////////////////////////////////////////////////
		////////////BUILD FROM MUTABLE BEANS			 //////////////////////////////////////////////////
		///////////////////////////////////////////////////////////////////////////////////////////////////
		public AgencyCore(IAgencyMutableObject bean, IAgencyScheme parent) : base(bean, parent) {
		}