示例#1
0
 public EntityMapper()
 {
     _language = _defaultLanguage;
     _localizedUtils = new LocalizedUtils(new System.Globalization.CultureInfo(_language));
 }
        protected void gvCodelistsItem_Sorting(object sender, GridViewSortEventArgs e)
        {
            ICodelistMutableObject cl = GetCodeListFromSession();

            if (cl == null) return;

            LocalizedUtils localUtils = new LocalizedUtils(Utils.LocalizedCulture);
            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);

            IList<CodeItem> lCodeListItem = new List<CodeItem>();
            foreach (ICode code in cl.ImmutableInstance.Items)
            {
                lCodeListItem.Add(new CodeItem(code.Id, localUtils.GetNameableName(code), localUtils.GetNameableDescription(code), code.ParentCode));
            }

            if ((SortDirection)ViewState["SortExpr"] == SortDirection.Ascending)
            {
                lCodeListItem = lCodeListItem.OrderBy(x => TypeHelper.GetPropertyValue(x, e.SortExpression)).Reverse().ToList();
                ViewState["SortExpr"] = SortDirection.Descending;
            }
            else
            {
                lCodeListItem = lCodeListItem.OrderBy(x => TypeHelper.GetPropertyValue(x, e.SortExpression)).ToList();
                ViewState["SortExpr"] = SortDirection.Ascending;
            }
            int numberOfRows = 0;
            if ( !txtNumberOfRows.Text.Trim().Equals( string.Empty ) && int.TryParse( txtNumberOfRows.Text, out numberOfRows ) )
            {
                gvCodelistsItem.PageSize = numberOfRows;
            }
            else if ( txtNumberOfRows.Text.Trim().Equals( string.Empty ) )
            {
                    gvCodelistsItem.PageSize = Utils.DetailsCodelistGridNumberRow;
            }
            gvCodelistsItem.DataSource = lCodeListItem;
            gvCodelistsItem.DataBind();
            Utils.AppendScript( "location.href='#codes'" );
        }
示例#3
0
        private ISdmxObjects GetSdmxObjects()
        {
            WSModel wsModel = new WSModel();
            ISdmxObjects sdmxInput;
            ISdmxObjects sdmxFinal;
            IMutableObjects mutableObj = new MutableObjectsImpl();
            LocalizedUtils localizedUtils = new LocalizedUtils(Utils.LocalizedCulture);
            bool stub = true;

            sdmxFinal = new SdmxObjectsImpl();

            if (hdnViewMode.Value == "Concept")
                stub = false;

            try
            {
                sdmxInput = wsModel.GetConceptScheme(new ArtefactIdentity(SearchBar1.ucID, SearchBar1.ucAgency, SearchBar1.ucVersion, ucIsFinalArtefact), stub, true);

                if (SearchBar1.ucName.Trim() != string.Empty)
                {

                    foreach (IConceptSchemeObject cs in sdmxInput.ConceptSchemes)
                    {
                        if (localizedUtils.GetNameableName(cs).Contains(SearchBar1.ucName.Trim()))
                            mutableObj.AddConceptScheme(cs.MutableInstance);

                    }
                    sdmxFinal = mutableObj.ImmutableObjects;

                }
                else
                    sdmxFinal = sdmxInput;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return sdmxFinal;
        }
        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();
            btnUpdateOrganizationUnit.DataBind();
            btnAddNewOrganizationUnit.DataBind();
            btnSaveMemoryOrganizationUnitScheme.DataBind();
            btnSaveAnnotationCode.DataBind();
            lblNumberOfRows.DataBind();
            btnClearFields.DataBind();
            btnClearFieldForUpdate.DataBind();
            btnChangePaging.DataBind();
            lbl_annotation.DataBind();
            lblSeparator.DataBind();
            _localizedUtils = new LocalizedUtils(Utils.LocalizedCulture);

            SetAction();

            if (!IsPostBack)
            {
                Utils.PopulateCmbAgencies(cmbAgencies, true);
                ClearSessionPage();
                txtNumberOfRows.Text = Utils.DetailsOrganizationUnitSchemeGridNumberRow.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 = "organizationunits";
                    AddTextName_Update.ucOpenPopUpWidth = 600;
                    AddTextName_Update.ucOpenPopUpName = "df-Dimension-update";

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

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

                    AddTextDescription_new.ucOpenTabName = "organizationunits";
                    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 = "organizationunits";
                    AddTextName_Update.ucOpenPopUpWidth = 600;
                    AddTextName_Update.ucOpenPopUpName = "df-Dimension-update";

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

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

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

                    /*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 = "organizationunits";
                    AddTextName_Update.ucOpenPopUpWidth = 600;
                    AddTextName_Update.ucOpenPopUpName = "df-Dimension-update";

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

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

                    AddTextDescription_new.ucOpenTabName = "organizationunits";
                    AddTextDescription_new.ucOpenPopUpWidth = 600;
                    AddTextDescription_new.ucOpenPopUpName = "df-Dimension";
                    /*
                    FileDownload31.ucID = _artIdentity.ID;
                    FileDownload31.ucAgency = _artIdentity.Agency;
                    FileDownload31.ucVersion = _artIdentity.Version;
                    FileDownload31.ucArtefactType = "OrganizationUnitScheme";
                     * */
                    break;
            }

            DuplicateArtefact1.ucStructureType = SdmxStructureEnumType.OrganisationUnitScheme;
            DuplicateArtefact1.ucMaintanableArtefact = GetOrganizationUnitSchemeFromSession();
        }
        private void BindData(bool isNewItem = false)
        {
            ICodelistMutableObject cl = GetCodeListFromSession();

            if (cl == null) return;

            SetGeneralTab(cl.ImmutableInstance);

            LocalizedUtils localUtils = new LocalizedUtils(Utils.LocalizedCulture);
            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);

            IList<CodeItem> lCodeListItem = new List<CodeItem>();
            foreach (ICode code in cl.ImmutableInstance.Items)
            {
                lCodeListItem.Add(new CodeItem(code.Id, localUtils.GetNameableName(code), localUtils.GetNameableDescription(code), code.ParentCode));
            }

            int numberOfRows = 0;

            if ( !txtNumberOfRows.Text.Trim().Equals( string.Empty ) && int.TryParse( txtNumberOfRows.Text, out numberOfRows ) )
            {
                gvCodelistsItem.PageSize = numberOfRows;
            }
            else
            {
                gvCodelistsItem.PageSize = Utils.DetailsCodelistGridNumberRow;
            }
            int numberOfTotalElements = lCodeListItem.Count;
            lblNumberOfTotalElements.Text = string.Format( Resources.Messages.lbl_number_of_total_rows, numberOfTotalElements.ToString() );
            gvCodelistsItem.DataSource = lCodeListItem;
            gvCodelistsItem.DataBind();

            if ( lCodeListItem.Count == 0 )
            {
                txtNumberOfRows.Visible = false;
                lblNumberOfRows.Visible = false;
                btnChangePaging.Visible = false;
                lblNoItemsPresent.Visible = true;
                lblNumberOfTotalElements.Visible = false;
            }
            else
            {
                txtNumberOfRows.Visible = true;
                lblNumberOfRows.Visible = true;
                btnChangePaging.Visible = true;
                lblNoItemsPresent.Visible = false;
                lblNumberOfTotalElements.Visible = true;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _localizedUtils = new LocalizedUtils(Utils.LocalizedCulture);

            SetAction();

            if(!IsPostBack)
            {
                if(HttpContext.Current.Request.QueryString["OCT"] != null)
                    Utils.AppendScript("location.href='#categorisation';");
            }

            switch (_action)
            {
                case Action.INSERT:
                    pnlAll.Visible = false;
                    pnlArtefactMustBeSaved.Visible = true;
                    break;
                case Action.UPDATE:
                    pnlAll.Visible = true;
                    pnlArtefactMustBeSaved.Visible = false;
                    btnAddCategorisation.Visible = true;
                    btnSaveCategorisation.Visible = true;
                    break;
                case Action.VIEW:
                    pnlAll.Visible = true;
                    pnlArtefactMustBeSaved.Visible = false;
                    btnAddCategorisation.Visible = false;
                    btnSaveCategorisation.Visible = false;

                    if (gvCategorisations.Columns != null || gvCategorisations.Columns.Count > 0)
                        gvCategorisations.Columns[5].Visible = false;
                    break;
                default:
                    break;
            }

            if (cmbCategorySchemes.Items.Count <=0)
            {
                PopolateCmbCategoryScheme();
                PopolateGVCategorisations();
            }
        }
        private void BindData(bool isNewItem = false)
        {
            IAgencySchemeMutableObject agencyScheme = GetAgencySchemeFromSession();

            if (agencyScheme == null) return;

            SetGeneralTab(agencyScheme.ImmutableInstance);

            LocalizedUtils localUtils = new LocalizedUtils(Utils.LocalizedCulture);
            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);
            IList<Agency> lAgencySchemeItem = new List<Agency>();

            foreach (IAgency agency in agencyScheme.ImmutableInstance.Items)
            {
                lAgencySchemeItem.Add(new Agency(agency.Id, localUtils.GetNameableName(agency), localUtils.GetNameableDescription(agency)));
            }

            int numberOfRows = 0;

            if ( !txtNumberOfRows.Text.Trim().Equals( string.Empty ) && int.TryParse( txtNumberOfRows.Text, out numberOfRows ) )
            {
                gvAgencyschemesItem.PageSize = numberOfRows;
            }
            else
            {
                gvAgencyschemesItem.PageSize = Utils.DetailsAgencyschemeGridNumberRow;
            }
            lblNumberOfTotalElements.Text = string.Format( Resources.Messages.lbl_number_of_total_rows, lAgencySchemeItem.Count.ToString() );
            gvAgencyschemesItem.DataSource = lAgencySchemeItem;
            gvAgencyschemesItem.DataBind();

            if ( lAgencySchemeItem.Count == 0 )
            {
                txtNumberOfRows.Visible = false;
                lblNumberOfRows.Visible = false;
                btnChangePaging.Visible = false;
                lblNoItemsPresent.Visible = true;
                lblNumberOfTotalElements.Visible = false;
            }
            else
            {
                txtNumberOfRows.Visible = true;
                lblNumberOfRows.Visible = true;
                btnChangePaging.Visible = true;
                lblNoItemsPresent.Visible = false;
                lblNumberOfTotalElements.Visible = true;
            }
        }
        private void BindData(bool isNewItem = false)
        {
            ICategorySchemeMutableObject cs = GetCategorySchemeFromSession();

            if (cs == null) return;

            SetGeneralTab(cs.ImmutableInstance);

            LocalizedUtils localUtils = new LocalizedUtils(Utils.LocalizedCulture);
            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);

            TreeView1.Nodes.Clear();

            IList<Category> lCategorySchemeItem = new List<Category>();
            TreeNode rootNode = new TreeNode(string.Format("[ {0} ] {1}", cs.Id, localUtils.GetNameableName(cs.ImmutableInstance)));
            rootNode.Value = cs.Id;

            foreach (ICategoryObject category in cs.ImmutableInstance.Items)
            {
                //TreeNode node = new TreeNode( string.Format( "{0} - {1} - {2}", category.Id, localUtils.GetNameableName( category ), localUtils.GetNameableDescription( category ) ) );
                TreeNode node = new TreeNode(string.Format("[ {0} ] {1}", category.Id, localUtils.GetNameableName(category)));
                node.Value = category.Id;
                node.SelectAction = TreeNodeSelectAction.Select;
                CreateTreeWithRecursion(category, node);
                rootNode.ChildNodes.Add(node);
                lCategorySchemeItem.Add(new Category(category.Id, localUtils.GetNameableName(category), localUtils.GetNameableDescription(category), (category.IdentifiableParent != null) ? category.IdentifiableParent.Id : string.Empty));
            }

            TreeView1.Nodes.Add(rootNode);
            rootNode.Expand();
        }
 private void CreateTreeWithRecursion(ICategoryObject category, TreeNode node)
 {
     LocalizedUtils localUtils = new LocalizedUtils(Utils.LocalizedCulture);
     if (category.Items.Count != 0)
     {
         int counter = 0;
         foreach (var subCategory in category.Items)
         {
             TreeNode tmpNode = new TreeNode(string.Format("[ {0} ] {1}", subCategory.Id, localUtils.GetNameableName(subCategory)));
             tmpNode.Value = subCategory.Id;
             tmpNode.SelectAction = TreeNodeSelectAction.Select;
             node.ChildNodes.Add(tmpNode);
             CreateTreeWithRecursion(subCategory, node.ChildNodes[counter]);
             counter++;
         }
     }
     else
     {
         //node.ChildNodes.Add( new TreeNode( category.Id ) );
         return;
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            _localizedUtils = new LocalizedUtils(Utils.LocalizedCulture);
            _sdmxObjects = new SdmxObjectsImpl();

            SetAction();

            if (!IsPostBack)
            {
                if (_action != Action.VIEW)
                    Utils.PopulateCmbAgencies(cmb_agencies, true);
                ClearSessionPage();

                //ViewState["SortExpr"] = "Code ASC";
            }

            switch (_action)
            {
                case Action.INSERT:

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

                    SetInitControls();
                    SetInsertForm();
                    SetStructureDetailPanel();
                    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;
                    }

                    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";

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

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

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

            if (!Utils.ViewMode && _action != Action.INSERT)
            {
                DuplicateArtefact1.ucStructureType = SdmxStructureEnumType.Categorisation;
                DuplicateArtefact1.ucMaintanableArtefact = GetCategorizationFromSession();
            }
            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();
            lblCategorySchemeList.DataBind();
            lblAvailableStructures.DataBind();
            btnOpenGridDiv.DataBind();
            btnOpenTreeDiv.DataBind();
            lblSelectedCategory.DataBind();
            lblSelectedItem.DataBind();

            /*lblImportCsvTitle.DataBind();
            lblCsvLanguage.DataBind();
            lblcsvFile.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_id_new.DataBind();
            lbl_order_new.DataBind();
            lbl_parentid_new.DataBind();
            lbl_description_new.DataBind();
            lbl_name_new.DataBind();

            imgImportCsv.DataBind();
            btnAddNewCode.DataBind();*/
            btnSaveMemoryCategorization.DataBind();
            /* btnImportFromCsv.DataBind();
             btnSaveAnnotationCode.DataBind();
             btnUpdateCode.DataBind();
             btnNewCode.DataBind();*/
        }
        private void PopulateAgenciesGrid()
        {
            WSModel wsModel = new WSModel();
            LocalizedUtils localizedUtils = new LocalizedUtils(Utils.LocalizedCulture);
            string[] agencySchemeParts = cmbAgencies.SelectedItem.Text.Split('+');
            string id = agencySchemeParts[0], agencyId = agencySchemeParts[1], version = agencySchemeParts[2];
            IAgencyScheme agencyScheme = wsModel.GetAgencyScheme(new ArtefactIdentity(id, agencyId, version), false, true).AgenciesSchemes.FirstOrDefault();
            List<AssociatedAgency> items = new List<AssociatedAgency>();
            foreach (var agency in agencyScheme.Items)
            {
                items.Add(new AssociatedAgency(agency.Id, localizedUtils.GetNameableName(agency), localizedUtils.GetNameableDescription(agency), true));
            }
            gridView.DataSource = items;
            gridView.DataBind();

            List<string> agencies = null;
            if (Session[SESSION_KEYS.AGENCIES_TO_SET] == null)
            {
                agencies = new List<string>();
            }
            else
            {
                agencies = Session[SESSION_KEYS.AGENCIES_TO_SET] as List<string>;
            }

            foreach (GridViewRow row in gridView.Rows)
            {
                if (((CheckBox)row.Cells[3].Controls[1]).Checked)
                {
                    string currentAgency = ((Label)row.Cells[0].Controls[1]).Text;
                    if (!agencies.Contains(currentAgency))
                    {
                        agencies.Add(string.Format("{0}|{1}", currentAgency, cmbAgencies.SelectedItem.Text));
                    }
                }
            }

            Session[SESSION_KEYS.AGENCIES_TO_SET] = agencies;
            if (Page.IsPostBack)
            {
                Utils.AppendScript("openP('setAgencyDiv', 400 );");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Org.Sdmxsource.Sdmx.Api.Exception.SdmxException.SetMessageResolver(new Org.Sdmxsource.Util.ResourceBundle.MessageDecoder());
            GetDSD1.ucDSDSelectedEH += new EventHandler<UserControls.GetDSDEventArgs>(GetDSD1_ucDSDSelectedEH);
            GetDataFlow1.ucDFSelectedEH += new EventHandler<UserControls.GetDFEventArgs>(GetDataFlow1_ucDFSelectedEH);

            _ccMutable = null;

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

            GetDSD1.ucAddIconType = AddIconType.cross;
            GetDataFlow1.ucAddIconType = AddIconType.cross;

            SetAction();

            if (!IsPostBack)
            {
                CommonInit();
            }

            switch (_action)
            {
                case Action.INSERT:
                    SetInsertForm();
                    if ( !Page.IsPostBack )
                    {
                        cmbAgencies.Items.Insert(0, new ListItem(String.Empty, String.Empty));
                        cmbAgencies.SelectedIndex = 0;
                        FileDownload31.Visible = false;
                    }
                    break;
                case Action.UPDATE:
                    SetEditForm();
                    break;
                case Action.VIEW:
                    SetViewForm();
                    Utils.ResetBeforeUnload();
                    break;
            }

            DuplicateArtefact1.ucStructureType = SdmxStructureEnumType.ContentConstraint;
            DuplicateArtefact1.ucMaintanableArtefact = _ccMutable;
        }
        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)
 {
     Page.Server.ScriptTimeout = 3600;
     Page.Form.Attributes.Add("enctype", "multipart/form-data");
     if (!Page.IsPostBack)
     {
         lblWait.DataBind();
         lbl.DataBind();
         btnConfirmImport.DataBind();
         btnUploadFile.DataBind();
         lblLoadFileAsmx.DataBind();
         lblSelectAll.DataBind();
         lblNoItemsAllowed.DataBind();
     }
     localizedUtils = new LocalizedUtils(Utils.LocalizedCulture);
 }
示例#15
0
 public EntityMapper(string localizedLanguage)
 {
     _language = localizedLanguage;
     _localizedUtils = new LocalizedUtils(new System.Globalization.CultureInfo(_language));
 }
        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)
        {
            Org.Sdmxsource.Sdmx.Api.Exception.SdmxException.SetMessageResolver(new Org.Sdmxsource.Util.ResourceBundle.MessageDecoder());

            _dfMutable = null;

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

            SetAction();

            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.Dataflow;
            DuplicateArtefact1.ucMaintanableArtefact = _dfMutable;

            lblDFID.DataBind();
            lblAgency.DataBind();
            lblVersion.DataBind();
            lblIsFinal.DataBind();
            lblURI.DataBind();
            lblURN.DataBind();
            lblValidFrom.DataBind();
            lblValidTo.DataBind();
            lblDSD.DataBind();
            lblDFNames.DataBind();
            lblDFDescriptions.DataBind();
            lbl_annotation.DataBind();

            btnSaveDF.DataBind();
        }
        private void PopolateDataTable(DataTable dt, ISdmxObjects sdmxObjects)
        {
            LocalizedUtils localizedUtils = new LocalizedUtils(Utils.LocalizedCulture);

            switch (ucArtefactType)
            {
                case "CodeList":
                    foreach (ICodelistObject codelist in sdmxObjects.Codelists)
                    {
                        foreach (ICode code in codelist.Items)
                        {
                            dt.Rows.Add(code.Id, localizedUtils.GetNameableName(code), localizedUtils.GetNameableDescription(code), code.ParentCode);
                        }
                        break;
                    }
                    break;
                case "ConceptScheme":
                    foreach (IConceptSchemeObject cs in sdmxObjects.ConceptSchemes)
                    {
                        foreach (IConceptObject concept in cs.Items)
                        {
                            dt.Rows.Add(concept.Id, localizedUtils.GetNameableName(concept), localizedUtils.GetNameableDescription( concept ), concept.ParentConcept );
                        }
                        break;
                    }
                    break;
                case "CategoryScheme":
                    foreach (ICategorySchemeObject cs in sdmxObjects.CategorySchemes)
                    {
                        foreach (ICategoryObject code in cs.Items)
                        {
                            string completeSequence = code.Parent.ToString().Split( '=' )[1].Split( ')' )[1];
                            if ( !completeSequence.Equals( string.Empty )  )
                            {
                                completeSequence = completeSequence.Remove( 0, 1 );
                            }
                            dt.Rows.Add(code.Id, localizedUtils.GetNameableName(code), localizedUtils.GetNameableDescription( code ), completeSequence );
                            if ( code.Items.Count != 0 )
                            {
                                foreach ( ICategoryObject subCode in code.Items )
                                {
                                    RecursiveOnItems( subCode, ref dt );
                                }
                            }
                        }
                        break;
                    }
                    break;
                case "DataFlow":
                    ISdmxObjects catObjects = GetCatObjects();
                    foreach (IDataflowObject dataFlow in sdmxObjects.Dataflows)
                    {
                        dt.Rows.Add("DataflowID", dataFlow.Id);
                        dt.Rows.Add("AgencyID", dataFlow.AgencyId);
                        dt.Rows.Add("Version", dataFlow.Version);
                        dt.Rows.Add("Name", localizedUtils.GetNameableName(dataFlow));
                        dt.Rows.Add("KeyFamilyID", dataFlow.DataStructureRef.MaintainableId);
                        dt.Rows.Add("KeyFamilyAgencyID", dataFlow.DataStructureRef.AgencyId);
                        dt.Rows.Add("KeyFamilyVersion", dataFlow.DataStructureRef.Version);

                        if (catObjects != null)
                        {
                            foreach (ICategorisationObject cat in catObjects.Categorisations)
                            {
                                if (cat.StructureReference.MaintainableId == dataFlow.Id &&
                                    cat.StructureReference.AgencyId == dataFlow.AgencyId &&
                                    cat.StructureReference.Version == dataFlow.Version)
                                {
                                    dt.Rows.Add("CategorySchemeID", cat.CategoryReference.MaintainableId);
                                    dt.Rows.Add("CategorySchemeAgencyID", cat.CategoryReference.AgencyId);
                                    dt.Rows.Add("CategorySchemeVersion", cat.CategoryReference.Version);
                                    dt.Rows.Add("CategoryID", cat.CategoryReference.FullId);
                                }
                            }
                        }
                        break;
                    }
                    break;
                case "Categorization":
                    foreach (ICategorisationObject cat in sdmxObjects.Categorisations)
                    {
                        dt.Rows.Add(cat.Id, localizedUtils.GetNameableName(cat), "");
                    }
                    break;
                case "AgencyScheme":
                    foreach (IAgencyScheme agency in sdmxObjects.AgenciesSchemes)
                    {
                        foreach (IAgency agencyItem in agency.Items)
                        {
                            dt.Rows.Add(agencyItem.Id, localizedUtils.GetNameableName(agencyItem), localizedUtils.GetNameableDescription( agencyItem ) );
                        }
                        break;
                    }
                    break;
                case "DataProviderScheme":
                    foreach (IDataProviderScheme dataProviderScheme in sdmxObjects.DataProviderSchemes)
                    {
                        foreach (IDataProvider dataProviderSchemeItem in dataProviderScheme.Items)
                        {
                            dt.Rows.Add(dataProviderSchemeItem.Id, localizedUtils.GetNameableName(dataProviderSchemeItem), localizedUtils.GetNameableDescription( dataProviderSchemeItem ) );
                        }
                        break;
                    }
                    break;
                case "DataConsumerScheme":
                    foreach (IDataConsumerScheme dataConsumerScheme in sdmxObjects.DataConsumerSchemes)
                    {
                        foreach (IDataConsumer dataConsumerSchemeItem in dataConsumerScheme.Items)
                        {
                            dt.Rows.Add(dataConsumerSchemeItem.Id, localizedUtils.GetNameableName(dataConsumerSchemeItem), localizedUtils.GetNameableDescription( dataConsumerSchemeItem ) );
                        }
                        break;
                    }
                    break;
                case "OrganizationUnitScheme":
                    foreach (IOrganisationUnitSchemeObject organizationUnitScheme in sdmxObjects.OrganisationUnitSchemes)
                    {
                        foreach (IOrganisationUnit organizationUnitSchemeItem in organizationUnitScheme.Items)
                        {
                            dt.Rows.Add(organizationUnitSchemeItem.Id, localizedUtils.GetNameableName(organizationUnitSchemeItem), localizedUtils.GetNameableDescription( organizationUnitSchemeItem ), organizationUnitSchemeItem.ParentUnit );
                        }
                        break;
                    }
                    break;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Org.Sdmxsource.Sdmx.Api.Exception.SdmxException.SetMessageResolver(new Org.Sdmxsource.Util.ResourceBundle.MessageDecoder());

            _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();
        }
 private void RecursiveOnItems( ICategoryObject code, ref DataTable dt )
 {
     LocalizedUtils localizedUtils = new LocalizedUtils(Utils.LocalizedCulture);
     string completeSequence = code.Parent.ToString().Split( '=' )[1].Split( ')' )[1];
     if ( !completeSequence.Equals( string.Empty )  )
     {
         completeSequence = completeSequence.Remove( 0, 1 );
     }
     dt.Rows.Add(code.Id, localizedUtils.GetNameableName(code), localizedUtils.GetNameableDescription( code ), completeSequence );
     if ( code.Items.Count != 0 )
     {
         foreach ( ICategoryObject subCode in code.Items )
         {
             RecursiveOnItems( subCode, ref dt );
         }
         return;
     }
     else
     {
         return;
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            Org.Sdmxsource.Sdmx.Api.Exception.SdmxException.SetMessageResolver(new Org.Sdmxsource.Util.ResourceBundle.MessageDecoder());

            _ssMutable = null;

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

            #region User COntrol Event Handler

            GetCodeListCLMSource.ucCodeListSelectedEH += new EventHandler<UserControls.GetCodeListEventArgs>(GetCodeListCLMSource_ucCodeListSelectedEH);
            GetCodeListCLMTarget.ucCodeListSelectedEH += new EventHandler<UserControls.GetCodeListEventArgs>(GetCodeListCLMTarget_ucCodeListSelectedEH);

            GetDSDSource.ucDSDSelectedEH += new EventHandler<UserControls.GetDSDEventArgs>(GetDSDSource_ucDSDSelectedEH);
            GetDSDTarget.ucDSDSelectedEH += new EventHandler<UserControls.GetDSDEventArgs>(GetDSDTarget_ucDSDSelectedEH);

            GetDataFlowSource.ucDFSelectedEH += new EventHandler<UserControls.GetDFEventArgs>(GetDataFlowSource_ucDFSelectedEH);
            GetDataFlowTarget.ucDFSelectedEH += new EventHandler<UserControls.GetDFEventArgs>(GetDataFlowTarget_ucDFSelectedEH);

            #endregion

            SetAction();

            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.StructureSet;
            DuplicateArtefact1.ucMaintanableArtefact = _ssMutable;

            if (!IsPostBack)
            {
                hdnCLMSourceCodeScrollTop.Value = "0";
                lbCLMSourceCode.Attributes.Add("onclick", "GetListBoxScrollPosition();");
                lbCLMSourceCode.Attributes.Add("onfocus", "SetListBoxScrollPosition();");

                hdnCLMTargetCodeScrollTop.Value = "0";
                lbCLMTargetCode.Attributes.Add("onclick", "GetListBoxScrollPosition();");

            }
            else
            {

                switch (hdnSelectedMappingType.Value)
                {
                    case "CLM":
                        lbCLMSourceCode.Focus();
                        break;
                    case "SM":
                        //lbSMSourceCode.Focus();
                        break;
                    default:
                break;
                }

            }
        }
        private ISdmxObjects GetSdmxObjects()
        {
            WSModel wsModel = new WSModel();
            ISdmxObjects sdmxInput;
            ISdmxObjects sdmxFinal;
            IMutableObjects mutableObj = new MutableObjectsImpl();
            LocalizedUtils localizedUtils = new LocalizedUtils(Utils.LocalizedCulture);

            sdmxFinal = new SdmxObjectsImpl();

            try
            {
                sdmxInput = wsModel.GetDataFlow(new ArtefactIdentity(SearchBar1.ucID, SearchBar1.ucAgency, SearchBar1.ucVersion, ucIsFinalArtefact), true, true);

                if (SearchBar1.ucName.Trim() != string.Empty)
                {

                    foreach (IDataflowObject df in sdmxInput.Dataflows)
                    {
                        if (localizedUtils.GetNameableName(df).Contains(SearchBar1.ucName.Trim()))
                            mutableObj.AddDataflow(df.MutableInstance);

                    }
                    sdmxFinal = mutableObj.ImmutableObjects;

                }
                else
                    sdmxFinal = sdmxInput;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return sdmxFinal;
        }
        private void BindData(bool isNewItem = false)
        {
            IOrganisationUnitSchemeMutableObject ous = GetOrganizationUnitSchemeFromSession();

            if (ous == null) return;

            SetGeneralTab(ous.ImmutableInstance);

            LocalizedUtils localUtils = new LocalizedUtils(Utils.LocalizedCulture);
            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);
            IList<OrganizationUnit> lOrganizationUnitSchemeItem = new List<OrganizationUnit>();

            foreach (IOrganisationUnit organizationUnit in ous.ImmutableInstance.Items)
            {
                lOrganizationUnitSchemeItem.Add(new OrganizationUnit(organizationUnit.Id, localUtils.GetNameableName(organizationUnit), localUtils.GetNameableDescription(organizationUnit), organizationUnit.ParentUnit));
            }

            int numberOfRows = 0;

            if ( !txtNumberOfRows.Text.Trim().Equals( string.Empty ) && int.TryParse( txtNumberOfRows.Text, out numberOfRows ) )
            {
                gvOrganizationunitschemesItem.PageSize = numberOfRows;
            }
            else
            {
                gvOrganizationunitschemesItem.PageSize = Utils.DetailsOrganizationUnitSchemeGridNumberRow;
            }
            lblNumberOfTotalElements.Text = string.Format( Resources.Messages.lbl_number_of_total_rows, lOrganizationUnitSchemeItem.Count.ToString() );

            gvOrganizationunitschemesItem.DataSource = lOrganizationUnitSchemeItem;
            gvOrganizationunitschemesItem.DataBind();

            if ( lOrganizationUnitSchemeItem.Count == 0 )
            {
                txtNumberOfRows.Visible = false;
                lblNumberOfRows.Visible = false;
                btnChangePaging.Visible = false;
            }
            else
            {
                txtNumberOfRows.Visible = true;
                lblNumberOfRows.Visible = true;
                btnChangePaging.Visible = true;
            }
        }
        private ISdmxObjects GetSdmxObjects()
        {
            WSModel wsModel = new WSModel();
            ISdmxObjects sdmxInput;
            ISdmxObjects sdmxFinal;
            IMutableObjects mutableObj = new MutableObjectsImpl();
            LocalizedUtils localizedUtils = new LocalizedUtils(Utils.LocalizedCulture);
            sdmxFinal = new SdmxObjectsImpl();

            try
            {
                sdmxInput = wsModel.GetOrganisationUnitScheme(new ArtefactIdentity(SearchBar1.ucID, SearchBar1.ucAgency, SearchBar1.ucVersion), true,true);

                if (SearchBar1.ucName.Trim() != string.Empty)
                {
                    foreach (IOrganisationUnitSchemeObject ous in sdmxInput.OrganisationUnitSchemes)
                    {
                        if (localizedUtils.GetNameableName(ous).ToUpper().Contains(SearchBar1.ucName.Trim().ToUpper()))
                            mutableObj.AddOrganisationUnitScheme(ous.MutableInstance);
                    }
                    sdmxFinal = mutableObj.ImmutableObjects;
                }
                else
                    sdmxFinal = sdmxInput;
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return sdmxFinal;
        }
        protected void btnChangePaging_Click(object sender, EventArgs e)
        {
            ICodelistMutableObject cl = GetCodeListFromSession();

            if (cl == null) return;

            LocalizedUtils localUtils = new LocalizedUtils(Utils.LocalizedCulture);
            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);

            IList<CodeItem> lCodeListItem = new List<CodeItem>();
            foreach (ICode code in cl.ImmutableInstance.Items)
            {
                lCodeListItem.Add(new CodeItem(code.Id, localUtils.GetNameableName(code), localUtils.GetNameableDescription(code), code.ParentCode));
            }

            int numberOfRows = 0;
            if ( !txtNumberOfRows.Text.Trim().Equals( string.Empty ) && int.TryParse( txtNumberOfRows.Text, out numberOfRows ) )
            {
                if ( numberOfRows > 0 )
                {
                    gvCodelistsItem.PageSize = numberOfRows;
                }
                else
                {
                    gvCodelistsItem.PageSize = Utils.DetailsCodelistGridNumberRow;
                    txtNumberOfRows.Text = Utils.DetailsCodelistGridNumberRow.ToString();
                }
            }
            else if ( !txtNumberOfRows.Text.Trim().Equals( string.Empty ) && !int.TryParse( txtNumberOfRows.Text, out numberOfRows ) )
            {
                Utils.ShowDialog( Resources.Messages.err_wrong_rows_number_pagination );
                Utils.AppendScript( "location.href='#codes';" );
                return;
            }
            else if ( txtNumberOfRows.Text.Trim().Equals( string.Empty ) )
            {
                gvCodelistsItem.PageSize = Utils.DetailsCodelistGridNumberRow;
                txtNumberOfRows.Text = Utils.DetailsCodelistGridNumberRow.ToString();
            }
            gvCodelistsItem.DataSource = lCodeListItem;
            gvCodelistsItem.DataBind();
            Utils.AppendScript( "location.href='#codes';" );
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Org.Sdmxsource.Sdmx.Api.Exception.SdmxException.SetMessageResolver(new Org.Sdmxsource.Util.ResourceBundle.MessageDecoder());
            GetCodeList1.ucCLSelectedEH += new EventHandler<UserControls.GetCodeListEventArgs>(GetCodeList1_ucCLSelectedEH);

            _hclMutable = null;

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

            GetCodeList1.ucAddIconType = AddIconType.cross;

            SetAction();

            if (!IsPostBack)
            {
                CommonInit();
                CurrentEditingAction = EditingAction.Add;
                TreeView1.Nodes.Add(new TreeNode("root", "@root@"));
                TreeView1.Nodes[0].Selected = true;
            }

            EditingAction a = CurrentEditingAction;

            switch (_action)
            {
                case Action.INSERT:
                    SetInsertForm();
                    if (!Page.IsPostBack)
                    {
                        cmbAgencies.Items.Insert(0, new ListItem(String.Empty, String.Empty));
                        cmbAgencies.SelectedIndex = 0;
                    }
                    break;
                case Action.UPDATE:
                    SetEditForm();
                    break;
                case Action.VIEW:
                    SetViewForm();
                    Utils.ResetBeforeUnload();
                    break;
            }

            DuplicateArtefact1.ucStructureType = SdmxStructureEnumType.HierarchicalCodelist;
            DuplicateArtefact1.ucMaintanableArtefact = _hclMutable;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _localizedUtils = new LocalizedUtils(Utils.LocalizedCulture);

            SetAction();

            if (!IsPostBack)
            {
                Utils.PopulateCmbAgencies(cmb_agencies, true);
                Utils.PopulateCmbAgencies(cmbLanguageForCsv, true);
                ClearSessionPage();
                ViewState["SortExpr"] = SortDirection.Ascending;
                txtNumberOfRows.Text = Utils.DetailsCodelistGridNumberRow.ToString();
            }

            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;
                    }
                    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";

                    /*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";
                    break;
            }

            DuplicateArtefact1.ucStructureType = SdmxStructureEnumType.CodeList;
            DuplicateArtefact1.ucMaintanableArtefact = GetCodeListFromSession();

            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)
        {
            _wsModel = new WSModel();
            _config = (CategoryViewConfigurationSection)System.Configuration.ConfigurationManager.GetSection("categoryViewConfigurationGroup/categoryViewConfiguration");
            _entityMapper = new EntityMapper(cmbLanguage.SelectedValue);
            ScriptManager.GetCurrent(this.Page).RegisterPostBackControl(FileDownload3);

            if (!IsPostBack)
            {
                FileDownload3.ucVisible = false;

                Session["WSEndPoint"] = _config.WsEndPoint;
                _artIdentity = Utils.GetIdentityFromRequest(Request);
                FillForm();

                cmbLanguage.SelectedValue = LocaleResolver.GetCookie(HttpContext.Current).TwoLetterISOLanguageName;
            }

            _localizedUtils = new LocalizedUtils(new System.Globalization.CultureInfo(cmbLanguage.SelectedValue));

            //if (!IsPostBack)
            //    if (cmbCategorySchemes.Items.Count == 1 || cmbCategorySchemes.Enabled == false)
            //        StartSearching();
        }