protected void Page_Load(object sender, EventArgs e)
        {
            // TEMPORARY LOG
            TemporaryLog("In caricamento pagina");

            _epe = (EndPointElement)Session[SESSION_KEYS.CURRENT_ENDPOINT_OBJECT];

            lblDSDID.DataBind();
            lblVersion.DataBind();
            lblAgency.DataBind();
            lblValidFrom.DataBind();
            lblValidTo.DataBind();
            lblDSDURI.DataBind();
            lblDSDURN.DataBind();
            lblIsFinal.DataBind();
            lblDSDName.DataBind();
            lblDSDDescription.DataBind();
            lblTitle.DataBind();
            lblNewCategoryId.DataBind();
            lblNewCategoryName.DataBind();
            lblNewCategoryDescription.DataBind();
            //lblParentCategoryNewCategory.DataBind();
            btnNewCategory.DataBind();
            lblTitleUpdateCategory.DataBind();
            lblUpdateCategoryID.DataBind();
            lblUpdateAnnotation.DataBind();
            lblUpdateCategoryName.DataBind();
            lblUpdateCategoryDescription.DataBind();
            lbl_annotation.DataBind();
            lblNewAnnotation.DataBind();
            //lblUpdateCategoryParentID.DataBind();
            btnUpdateCategory.DataBind();
            btnAddNewCategory.DataBind();
            btnSaveMemoryCategoryScheme.DataBind();
            btnDeleteCategory.DataBind();
            btnUpdateSelectedCategory.DataBind();
            lblImportCsvTitle.DataBind();
            lblCsvLanguage.DataBind();
            lblcsvFile.DataBind();
            btnImportFromCsv.DataBind();
            btnCancelMoveCategory.DataBind();
            lblCategoryOrder.DataBind();
            btnDeselectCategory.DataBind();
            btnClearFieldForUpdate.DataBind();
            btnClearFields.DataBind();
            lblSeparator.DataBind();
            _localizedUtils = new LocalizedUtils(Utils.LocalizedCulture);

            SetAction();

            if (!IsPostBack)
            {
                lblMoveInstructions.DataBind();
                btnMoveCategory.DataBind();

                if(!_epe.PartialArtefact)
                    Utils.PopulateCmbAgencies(cmbAgencies, true);

                ClearSessionPage();
                AnnotationNewControl.ClearAnnotationsSession();
                AnnotationUpdateControl.ClearAnnotationsSession();
            }

            switch (_action)
            {
                case Action.INSERT:
                    AspConfirmationExit = "true";

                    if (!Page.IsPostBack)
                    {
                        ClearSessionPage();
                    }

                    SetInitControls();
                    SetInsertForm();

                    chkIsFinal.Checked = false;
                    chkIsFinal.Enabled = false;
                    if (!Page.IsPostBack)
                    {
                        cmbAgencies.Items.Insert(0, new ListItem(String.Empty, String.Empty));
                        cmbAgencies.SelectedIndex = 0;
                        FileDownload31.Visible = false;
                    }
                    break;
                case Action.UPDATE:

                    _artIdentity = Utils.GetIdentityFromRequest(Request);

                    SetInitControls();
                    SetEditForm();

                    break;
                case Action.VIEW:

                    _artIdentity = Utils.GetIdentityFromRequest(Request);

                    ClearSessionPage();

                    SetViewForm();

                    FileDownload31.ucID = _artIdentity.ID;
                    FileDownload31.ucAgency = _artIdentity.Agency;
                    FileDownload31.ucVersion = _artIdentity.Version;
                    FileDownload31.ucArtefactType = "CategoryScheme";

                    break;
            }

            NewCategoryAddTextName.ucOpenTabName = "categories";
            NewCategoryAddTextName.ucOpenPopUpWidth = 600;
            NewCategoryAddTextName.ucOpenPopUpName = "df-Dimension";

            NewCategoryAddTextDescription.ucOpenTabName = "categories";
            NewCategoryAddTextDescription.ucOpenPopUpWidth = 600;
            NewCategoryAddTextDescription.ucOpenPopUpName = "df-Dimension";

            AddText1.ucOpenTabName = "categories";
            AddText1.ucOpenPopUpWidth = 600;
            AddText1.ucOpenPopUpName = "df-Dimension-update";

            AddText2.ucOpenTabName = "categories";
            AddText2.ucOpenPopUpWidth = 600;
            AddText2.ucOpenPopUpName = "df-Dimension-update";

            AnnotationNewControl.AddText_ucOpenTabName = "categories";
            AnnotationNewControl.AddText_ucOpenPopUpWidth = 600;
            AnnotationNewControl.AddText_ucOpenPopUpName = AnnotationNewControl.ClientID;
            AnnotationNewControl.PopUpContainer = "df-Dimension";

            AnnotationUpdateControl.AddText_ucOpenTabName = "categories";
            AnnotationUpdateControl.AddText_ucOpenPopUpWidth = 600;
            AnnotationUpdateControl.AddText_ucOpenPopUpName = AnnotationUpdateControl.ClientID;
            AnnotationUpdateControl.PopUpContainer = "df-Dimension-update";

            if (chkIsFinal.Checked || _action == Action.VIEW)
            {
                btnAddNewCategory.Visible = false;
                btnCancelMoveCategory.Visible = false;
                btnDeleteCategory.Visible = false;
                btnDeselectCategory.Visible = false;
                btnImportFromCsv.Visible = false;
                btnUpdateSelectedCategory.Visible = false;
                btnMoveCategory.Visible = false;
                txtCategoryOrder.Visible = false;
                lblMoveInstructions.Visible = false;
                lblCategoryOrder.Visible = false;
            }
            else
            {
                btnAddNewCategory.Visible = true;
                btnCancelMoveCategory.Visible = true;
                btnDeleteCategory.Visible = true;
                btnDeselectCategory.Visible = true;
                btnImportFromCsv.Visible = true;
                btnUpdateSelectedCategory.Visible = true;
                btnMoveCategory.Visible = true;
                txtCategoryOrder.Visible = true;
                lblMoveInstructions.Visible = true;
                lblCategoryOrder.Visible = true;
            }

            if (!_epe.PartialArtefact)
            {
                DuplicateArtefact1.ucStructureType = SdmxStructureEnumType.CategoryScheme;
                DuplicateArtefact1.ucMaintanableArtefact = GetCategorySchemeFromSession();
            }
            else
                DuplicateArtefact1.ucDisable = true;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            lblImportCsvTitle.DataBind();
            lblCsvLanguage.DataBind();
            lblcsvFile.DataBind();
            btnImportFromCsv.DataBind();
            lblDSDID.DataBind();
            lblVersion.DataBind();
            lblAgency.DataBind();
            lblValidFrom.DataBind();
            lblValidTo.DataBind();
            lblDSDURI.DataBind();
            lblDSDURN.DataBind();
            lblIsFinal.DataBind();
            lblDSDName.DataBind();
            lblDSDDescription.DataBind();
            lbl_title_new.DataBind();
            lbl_id_new.DataBind();
            lbl_name_new.DataBind();
            lbl_description_new.DataBind();
            lbl_parentid_new.DataBind();
            btnNewConcept.DataBind();
            lbl_title_update.DataBind();
            lbl_id_update.DataBind();
            lbl_name_update.DataBind();
            lbl_description_update.DataBind();
            lbl_parentid_update.DataBind();
            btnUpdateConcept.DataBind();
            btnAddNewConcept.DataBind();
            btnSaveMemoryConceptScheme.DataBind();
            btnSaveAnnotationCode.DataBind();
            lblNumberOfRows.DataBind();
            btnClearFields.DataBind();
            btnClearFieldForUpdate.DataBind();
            btnChangePaging.DataBind();
            lbl_annotation.DataBind();
            lblSeparator.DataBind();

            _localizedUtils = new LocalizedUtils(Utils.LocalizedCulture);
            _epe = (EndPointElement)Session[SESSION_KEYS.CURRENT_ENDPOINT_OBJECT];

            SetAction();

            if (!IsPostBack)
            {
                if (!_epe.PartialArtefact)
                    Utils.PopulateCmbAgencies(cmbAgencies, true);

                ClearSessionPage();
                txtNumberOfRows.Text = Utils.DetailsConceptschemeGridNumberRow.ToString();
                AnnotationGeneralControl.ClearAnnotationsSession();
            }

            switch (_action)
            {
                case Action.INSERT:

                    //ClearSessionPage();

                    AspConfirmationExit = "true";

                    SetInitControls();
                    SetInsertForm();

                    lblNumberOfRows.Visible = false;
                    txtNumberOfRows.Visible = false;
                    btnChangePaging.Visible = false;

                    chkIsFinal.Checked = false;
                    chkIsFinal.Enabled = false;

                    AddTextName_Update.ucOpenTabName = "concepts";
                    AddTextName_Update.ucOpenPopUpWidth = 600;
                    AddTextName_Update.ucOpenPopUpName = "df-Dimension-update";

                    AddTextDescription_Update.ucOpenTabName = "concepts";
                    AddTextDescription_Update.ucOpenPopUpWidth = 600;
                    AddTextDescription_Update.ucOpenPopUpName = "df-Dimension-update";

                    AddTextName_new.ucOpenTabName = "concepts";
                    AddTextName_new.ucOpenPopUpWidth = 600;
                    AddTextName_new.ucOpenPopUpName = "df-Dimension";

                    AddTextDescription_new.ucOpenTabName = "concepts";
                    AddTextDescription_new.ucOpenPopUpWidth = 600;
                    AddTextDescription_new.ucOpenPopUpName = "df-Dimension";
                    if (!Page.IsPostBack)
                    {
                        cmbAgencies.Items.Insert(0, new ListItem(String.Empty, String.Empty));
                        cmbAgencies.SelectedIndex = 0;
                        FileDownload31.Visible = false;
                    }
                    break;
                case Action.UPDATE:

                    _artIdentity = Utils.GetIdentityFromRequest(Request);
                    //ClearSessionPage();

                    SetInitControls();
                    SetEditForm();

                    AddTextName_Update.ucOpenTabName = "concepts";
                    AddTextName_Update.ucOpenPopUpWidth = 600;
                    AddTextName_Update.ucOpenPopUpName = "df-Dimension-update";

                    AddTextDescription_Update.ucOpenTabName = "concepts";
                    AddTextDescription_Update.ucOpenPopUpWidth = 600;
                    AddTextDescription_Update.ucOpenPopUpName = "df-Dimension-update";

                    AddTextName_new.ucOpenTabName = "concepts";
                    AddTextName_new.ucOpenPopUpWidth = 600;
                    AddTextName_new.ucOpenPopUpName = "df-Dimension";

                    AddTextDescription_new.ucOpenTabName = "concepts";
                    AddTextDescription_new.ucOpenPopUpWidth = 600;
                    AddTextDescription_new.ucOpenPopUpName = "df-Dimension";

                    Categorisations.ucArtefactType = AvailableStructures.CONCEPT_SCHEME;
                    Categorisations.ucArtIdentity = _artIdentity;

                    /*if (gvConceptschemesItem.Rows.Count > 0)
                        chkIsFinal.Enabled = true;
                    else
                        chkIsFinal.Enabled = false;*/

                    break;
                case Action.VIEW:

                    _artIdentity = Utils.GetIdentityFromRequest(Request);
                    ClearSessionPage();
                    SetViewForm();

                    AddTextName_Update.ucOpenTabName = "concepts";
                    AddTextName_Update.ucOpenPopUpWidth = 600;
                    AddTextName_Update.ucOpenPopUpName = "df-Dimension-update";

                    AddTextDescription_Update.ucOpenTabName = "concepts";
                    AddTextDescription_Update.ucOpenPopUpWidth = 600;
                    AddTextDescription_Update.ucOpenPopUpName = "df-Dimension-update";

                    AddTextName_new.ucOpenTabName = "concepts";
                    AddTextName_new.ucOpenPopUpWidth = 600;
                    AddTextName_new.ucOpenPopUpName = "df-Dimension";

                    AddTextDescription_new.ucOpenTabName = "concepts";
                    AddTextDescription_new.ucOpenPopUpWidth = 600;
                    AddTextDescription_new.ucOpenPopUpName = "df-Dimension";
                    /*
                    FileDownload31.ucID = _artIdentity.ID;
                    FileDownload31.ucAgency = _artIdentity.Agency;
                    FileDownload31.ucVersion = _artIdentity.Version;
                    FileDownload31.ucArtefactType = "ConceptScheme";*/

                    break;
            }

            if (!_epe.PartialArtefact)
            {
                DuplicateArtefact1.ucStructureType = SdmxStructureEnumType.ConceptScheme;
                DuplicateArtefact1.ucMaintanableArtefact = GetConceptSchemeFromSession();
            }
            else
                DuplicateArtefact1.ucDisable = true;

            if (_action == Action.INSERT)
                DuplicateArtefact1.Visible = false;

            lblNoItemsPresent.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _localizedUtils = new LocalizedUtils(Utils.LocalizedCulture);
            _epe = (EndPointElement)Session[SESSION_KEYS.CURRENT_ENDPOINT_OBJECT];

            CSVImporter1.OperationComplete += CSVImporter1_OperationComplete;

            SetAction();

            if (!IsPostBack)
            {
                if (!_epe.PartialArtefact)
                {
                    Utils.PopulateCmbAgencies(cmb_agencies, true);
                    //Utils.PopulateCmbLanguages(cmbLanguageForCsv, AVAILABLE_MODES.MODE_FOR_ADD_TEXT);
                }

                ClearSessionPage();
                ViewState["SortExpr"] = SortDirection.Ascending;
                txtNumberOfRows.Text = Utils.DetailsCodelistGridNumberRow.ToString();
            }

            ICodelistMutableObject cl;

            switch (_action)
            {
                case Action.INSERT:

                    //ClearSessionPage();
                    AspConfirmationExit = "true";

                    SetInitControls();
                    SetInsertForm();

                    lblNumberOfRows.Visible = false;
                    txtNumberOfRows.Visible = false;
                    btnChangePaging.Visible = false;

                    chk_isFinal.Checked = false;
                    chk_isFinal.Enabled = false;

                    AddTextName_update.ucOpenTabName = "codes";
                    AddTextName_update.ucOpenPopUpWidth = 600;
                    AddTextName_update.ucOpenPopUpName = "df-Dimension-update";

                    AddTextDescription_update.ucOpenTabName = "codes";
                    AddTextDescription_update.ucOpenPopUpWidth = 600;
                    AddTextDescription_update.ucOpenPopUpName = "df-Dimension-update";

                    AddTextName_new.ucOpenTabName = "codes";
                    AddTextName_new.ucOpenPopUpWidth = 600;
                    AddTextName_new.ucOpenPopUpName = "df-Dimension";

                    AddTextDescription_new.ucOpenTabName = "codes";
                    AddTextDescription_new.ucOpenPopUpWidth = 600;
                    AddTextDescription_new.ucOpenPopUpName = "df-Dimension";

                    if (!Page.IsPostBack)
                    {
                        cmb_agencies.Items.Insert(0, new ListItem(String.Empty, String.Empty));
                        cmb_agencies.SelectedIndex = 0;

                        FileDownload31.Visible = false;
                    }

                    cl = GetCodeListFromSession();
                    if (cl == null) cl = GetCodelistForm(true);
                    else cl = GetCodelistForm(cl);

                    if (cl == null)
                    {
                        cl = new CodelistMutableCore();
                        cl.Id = "@fitt@";
                        cl.AgencyId = "@fitt@";
                        cl.Version = "1.0";
                        cl.AddName("it", "@fitt@");

                    }

                    CSVImporter1.ucCodelist = cl;

                    break;
                case Action.UPDATE:

                    _artIdentity = Utils.GetIdentityFromRequest(Request);

                    SetInitControls();
                    SetEditForm();

                    AddTextName_update.ucOpenTabName = "codes";
                    AddTextName_update.ucOpenPopUpWidth = 600;
                    AddTextName_update.ucOpenPopUpName = "df-Dimension-update";

                    AddTextDescription_update.ucOpenTabName = "codes";
                    AddTextDescription_update.ucOpenPopUpWidth = 600;
                    AddTextDescription_update.ucOpenPopUpName = "df-Dimension-update";

                    AddTextName_new.ucOpenTabName = "codes";
                    AddTextName_new.ucOpenPopUpWidth = 600;
                    AddTextName_new.ucOpenPopUpName = "df-Dimension";

                    AddTextDescription_new.ucOpenTabName = "codes";
                    AddTextDescription_new.ucOpenPopUpWidth = 600;
                    AddTextDescription_new.ucOpenPopUpName = "df-Dimension";

                    Categorisations.ucArtefactType = AvailableStructures.CODELIST;
                    Categorisations.ucArtIdentity = _artIdentity;

                    // NEW
                    bool b = (bool)_artIdentity.IsFinal;

                    cl = GetCodeListFromSession();
                    if (cl == null) cl = GetCodelistForm(b);
                    else cl = GetCodelistForm(cl,b);
                    CSVImporter1.ucCodelist = cl;

                    /*if (gvCodelistsItem.Rows.Count > 0 )
                    {
                        chk_isFinal.Enabled = true;
                    }
                    else
                    {
                        chk_isFinal.Enabled = false;
                    }*/
                    break;
                case Action.VIEW:

                    _artIdentity = Utils.GetIdentityFromRequest(Request);
                    ClearSessionPage();
                    SetViewForm();

                    AddTextName_update.ucOpenTabName = "codes";
                    AddTextName_update.ucOpenPopUpWidth = 600;
                    AddTextName_update.ucOpenPopUpName = "df-Dimension-update";

                    AddTextDescription_update.ucOpenTabName = "codes";
                    AddTextDescription_update.ucOpenPopUpWidth = 600;
                    AddTextDescription_update.ucOpenPopUpName = "df-Dimension-update";

                    AddTextName_new.ucOpenTabName = "codes";
                    AddTextName_new.ucOpenPopUpWidth = 600;
                    AddTextName_new.ucOpenPopUpName = "df-Dimension";

                    AddTextDescription_new.ucOpenTabName = "codes";
                    AddTextDescription_new.ucOpenPopUpWidth = 600;
                    AddTextDescription_new.ucOpenPopUpName = "df-Dimension";

                    FileDownload31.ucID = _artIdentity.ID;
                    FileDownload31.ucAgency = _artIdentity.Agency;
                    FileDownload31.ucVersion = _artIdentity.Version;
                    FileDownload31.ucArtefactType = "CodeList";

                    Categorisations.ucArtefactType = AvailableStructures.CODELIST;
                    Categorisations.ucArtIdentity = _artIdentity;

                    break;
            }

            if (!_epe.PartialArtefact)
            {
                DuplicateArtefact1.ucStructureType = SdmxStructureEnumType.CodeList;
                DuplicateArtefact1.ucMaintanableArtefact = GetCodeListFromSession();
            }
            else
                DuplicateArtefact1.ucDisable = true;

            lbl_id.DataBind();
            lbl_agency.DataBind();
            lbl_version.DataBind();
            lbl_isFinal.DataBind();
            lbl_uri.DataBind();
            lbl_urn.DataBind();
            lbl_valid_from.DataBind();
            lbl_valid_to.DataBind();
            lbl_name.DataBind();
            lbl_description.DataBind();
            lbl_annotation.DataBind();
            btnChangePaging.DataBind();
            //lblImportCsvTitle.DataBind();
            //lblCsvLanguage.DataBind();
            //lblcsvFile.DataBind();
            lblNoItemsPresent.DataBind();
            lbl_title_popup_code.DataBind();

            lbl_id_update.DataBind();
            lbl_order_update.DataBind();
            lbl_parentid_update.DataBind();
            lbl_description_update.DataBind();
            lbl_name_update.DataBind();
            lbl_title_update.DataBind();
            lbl_id_new.DataBind();
            lbl_order_new.DataBind();
            lbl_parentid_new.DataBind();
            lbl_description_new.DataBind();
            lbl_name_new.DataBind();
            btnClearFields.DataBind();
            btnClearFieldForUpdate.DataBind();
            //imgImportCsv.DataBind();
            btnAddNewCode.DataBind();
            btnSaveMemoryCodeList.DataBind();
            //btnImportFromCsv.DataBind();
            btnSaveAnnotationCode.DataBind();
            btnUpdateCode.DataBind();
            btnNewCode.DataBind();
            lblNumberOfRows.DataBind();
            //lblSeparator.DataBind();
            btnNewCodeOnFinalStructure.DataBind();
            lblYouAreWorkingOnAFinal.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Org.Sdmxsource.Sdmx.Api.Exception.SdmxException.SetMessageResolver(new Org.Sdmxsource.Util.ResourceBundle.MessageDecoder());
            _epe = (EndPointElement)Session[SESSION_KEYS.CURRENT_ENDPOINT_OBJECT];

            _dsdMutable = null;

            _sdmxUtils = new SDMXUtils();
            _localizedUtils = new LocalizedUtils(Utils.LocalizedCulture);
            _entityMapper = new EntityMapper(Utils.LocalizedLanguage);
            _artIdentity = Utils.GetIdentityFromRequest(Request);

            SetAction();

            CommonInitUserControl();

            if (!IsPostBack)
            {
                CommonInit();
            }

            switch (_action)
            {
                case Action.INSERT:
                    SetInsertForm();
                    break;
                case Action.UPDATE:
                    SetEditForm();
                    break;
                case Action.VIEW:
                    SetViewForm();
                    Utils.ResetBeforeUnload();
                    break;
            }

            DuplicateArtefact1.ucStructureType = SdmxStructureEnumType.Dsd;
            DuplicateArtefact1.ucMaintanableArtefact = _dsdMutable;

            lblDSDDescription.DataBind();
            lblDSDName.DataBind();
            lblDSDID.DataBind();
            lblAgency.DataBind();
            lblVersion.DataBind();
            lblIsFinal.DataBind();
            lblDSDURI.DataBind();
            lblValidTo.DataBind();
            lblValidFrom.DataBind();
            lblDSDURN.DataBind();
            lblDSDURI.DataBind();
            lblPMID.DataBind();
            lblCodelist.DataBind();
            lblConcept.DataBind();
            lblTitle.DataBind();
            lblDimType.DataBind();
            lblDimID.DataBind();
            lblDimConceptReference.DataBind();
            lblDimConcept.DataBind();
            lblCodeConceptScheme.DataBind();
            lblCodeCodelist.DataBind();
            lblCodeCodeRappresentation.DataBind();
            btnAddDimension.DataBind();
            btnSaveDSD.DataBind();
            lblAddGroupTitle.DataBind();
            lblGroupID.DataBind();
            lblGroupDimension.DataBind();
            btnAddGroup.DataBind();
            lbl_annotation.DataBind();
            lblAnnotaionPM.DataBind();
        }