protected void gvCodeListMap_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            switch (e.CommandName)
            {
                case "Details":
                    GridViewRow gvr = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);
                    string clmID = ((Label)gvr.FindControl("lblCLMID")).Text;
                    string[] clSourceID = ((Label)gvr.FindControl("lblCLMCLSource")).Text.Split(',');
                    string[] clTargetID = ((Label)gvr.FindControl("lblCLMCLTarget")).Text.Split(',');

                    ArtefactIdentity aiCLSource = new ArtefactIdentity(clSourceID[0].Trim(), clSourceID[1].Trim(), clSourceID[2].Trim());
                    ArtefactIdentity aiCLTarget = new ArtefactIdentity(clTargetID[0].Trim(), clTargetID[1].Trim(), clTargetID[2].Trim());

                    hdCLMAction.Value = Action.UPDATE.ToString();

                    //++++ General
                    txtCLMID.Text = clmID;
                    ICodelistMapMutableObject clmap = GetCurrentCLM();

                    AddTextCLMNames.InitTextObjectMutableList = clmap.Names;
                    AddTextCLMDescription.InitTextObjectMutableList = clmap.Descriptions;
                    ControlAnnotationsCLM.AnnotationObjectList = clmap.Annotations;

                    //++++ Mapping

                    //TODO: da rivedere
                    ArtefactTypeInit();

                    txtCLSource.Text = aiCLSource.ToString();
                    txtCLTarget.Text = aiCLTarget.ToString();

                    PopolateCLMLBSource(aiCLSource);
                    PopolateCLMLBTarget(aiCLTarget);

                    PopolateMapping();

                    Utils.AppendScript("tabindex = 0;");
                    txtCLMID.Enabled = false;
                    OpenAddCLMPopUp();

                    break;

                case "Annotation":
                    break;
            }
        }
        protected void gvStructureMap_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            switch (e.CommandName)
            {
                case "Details":
                    GridViewRow gvr = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);
                    string smID = ((Label)gvr.FindControl("lblSMID")).Text;
                    string[] SourceID = ((Label)gvr.FindControl("lblSMArtefactSource")).Text.Split(',');
                    string[] TargetID = ((Label)gvr.FindControl("lblSMArtefactTarget")).Text.Split(',');
                    string artType = ((Label)gvr.FindControl("lblSMArtefactType")).Text;

                    AvailableStructures avStruct = AvailableStructures.KEY_FAMILY;

                    if (artType.ToUpper() == "DATAFLOW")
                    {
                        cmbArtefactType.SelectedIndex = 1;
                        avStruct = AvailableStructures.DATAFLOW;
                    }
                    else
                        cmbArtefactType.SelectedIndex = 1;

                    ArtefactIdentity aiSource = new ArtefactIdentity(SourceID[0].Trim(), SourceID[1].Trim(), SourceID[2].Trim());
                    ArtefactIdentity aiTarget = new ArtefactIdentity(TargetID[0].Trim(), TargetID[1].Trim(), TargetID[2].Trim());

                    hdCLMAction.Value = Action.UPDATE.ToString();

                    //++++ General
                    txtSMID.Text = smID;
                    IStructureMapMutableObject smmap = GetCurrentSM();

                    AddTextSMNames.InitTextObjectMutableList = smmap.Names;
                    AddTextSMDescription.InitTextObjectMutableList = smmap.Descriptions;
                    ControlAnnotationsSM.AnnotationObjectList = smmap.Annotations;

                    //++++ Mapping
                    txtArtefactSource.Text = aiSource.ToString();
                    txtArtefactTarget.Text = aiTarget.ToString();

                    PopolateSMLBSource(aiSource, avStruct);
                    PopolateSMLBTarget(aiTarget, avStruct);

                    PopolateSMMapping();

                    Utils.AppendScript("tabindex = 0;");
                    txtSMID.Enabled = false;
                    OpenAddStructureMapPopUp();

                    break;

                case "Annotation":
                    break;
            }
        }
        private void FillArtefacts(TreeNode tn, ICategoryObject cat)
        {
            var foundedCat = _sdmxCS.Categorisations.Where(c => c.CategoryReference.IdentifiableIds[0] == cat.Id);

            string artefactType;
            ISdmxObjects sdmxObject;
            ArtefactIdentity ai;

            foreach (ICategorisationObject catObj in foundedCat)
            {
                artefactType = catObj.StructureReference.MaintainableStructureEnumType.EnumType.ToString();

                if (_lVisibleArtefacts.Where(c => c.Contains(artefactType.ToUpper())).FirstOrDefault() != null)
                {
                    ai = new ArtefactIdentity(catObj.StructureReference.MaintainableId, catObj.StructureReference.AgencyId, catObj.StructureReference.Version);

                    sdmxObject = GetSdmxObjectArtefact(artefactType, ai);

                    TreeNode tnArt = new TreeNode(" " + GetArtefactName(sdmxObject));
                    tnArt.Text += String.Format(" [{0},{1},{2}]", ai.ID, ai.Agency, ai.Version);
                    tnArt.ToolTip = string.Format("ID: {0}\n\rAgency: {1}\n\rVersion: {2}", ai.ID, ai.Agency, ai.Version);
                    tnArt.Value = artefactType + "|" + ai.ToString();
                    tnArt.ImageUrl = @"./images/" + artefactType + ".png";
                    tn.ChildNodes.Add(tnArt);

                    ExpandToRoot(tnArt);

                }
            }
        }