protected void btnChangePaging_Click(object sender, EventArgs e)
 {
     EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);
     List<ISTAT.Entity.OrganizationUnitScheme> lOrganizationUnitscheme = eMapper.GetOrganizationUnitSchemeList(_sdmxObjects);
     int numberOfRows = 0;
     if ( !txtNumberOfRows.Text.Trim().Equals( string.Empty ) && int.TryParse( txtNumberOfRows.Text, out numberOfRows ) )
     {
         if ( numberOfRows > 0 )
         {
             gridView.PageSize = numberOfRows;
         }
         else
         {
             gridView.PageSize = Utils.GeneralOrganizationUnitSchemeGridNumberRow;
             txtNumberOfRows.Text = Utils.GeneralOrganizationUnitSchemeGridNumberRow.ToString();
         }
     }
     else if ( !txtNumberOfRows.Text.Trim().Equals( string.Empty ) && !int.TryParse( txtNumberOfRows.Text, out numberOfRows ) )
     {
         Utils.ShowDialog( Resources.Messages.err_wrong_rows_number_pagination );
         return;
     }
     else if ( txtNumberOfRows.Text.Trim().Equals( string.Empty ) )
     {
         gridView.PageSize = Utils.GeneralOrganizationUnitSchemeGridNumberRow;
         txtNumberOfRows.Text = Utils.GeneralOrganizationUnitSchemeGridNumberRow.ToString();
     }
     gridView.DataSourceID = null;
     gridView.DataSource = lOrganizationUnitscheme;
     gridView.DataBind();
 }
        private void BindData()
        {
            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);

            List<ISTAT.Entity.OrganizationUnitScheme> _list = eMapper.GetOrganizationUnitSchemeList(_sdmxObjects, Utils.LocalizedLanguage);

            int numberOfRows = 0;

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

            if ( _list.Count == 0 )
            {
                txtNumberOfRows.Visible = false;
                lblNumberOfRows.Visible = false;
                btnChangePaging.Visible = false;
            }
            else
            {
                txtNumberOfRows.Visible = true;
                lblNumberOfRows.Visible = true;
                btnChangePaging.Visible = true;
            }
        }
 private List<ISTAT.Entity.StructureSet> GetStructureSetList()
 {
     EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);
     return eMapper.GetStructureSetList(_sdmxObjects, Utils.LocalizedLanguage);
 }
        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';" );
        }
        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;
            }
        }
        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;
                }

            }
        }
        protected void btnChangePaging_Click(object sender, EventArgs e)
        {
            IAgencySchemeMutableObject agencyScheme = GetAgencySchemeFromSession();

            if (agencyScheme == null) return;

            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);
            List<ISTAT.Entity.AgencyScheme> lConceptscheme = eMapper.GetAgencySchemeList(_sdmxObjects);
            IList<Agency> lAgencySchemeItem = new List<Agency>();

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

            int numberOfRows = 0;

            if ( !txtNumberOfRows.Text.Trim().Equals( string.Empty ) && int.TryParse( txtNumberOfRows.Text, out numberOfRows ) )
            {
                if ( numberOfRows > 0 )
                {
                    gvAgencyschemesItem.PageSize = numberOfRows;
                }
                else
                {
                    gvAgencyschemesItem.PageSize = Utils.DetailsAgencyschemeGridNumberRow;
                    txtNumberOfRows.Text = Utils.DetailsAgencyschemeGridNumberRow.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='#agencies';" );
                return;
            }
            else if ( txtNumberOfRows.Text.Trim().Equals( string.Empty ) )
            {
                gvAgencyschemesItem.PageSize = Utils.DetailsAgencyschemeGridNumberRow;
                txtNumberOfRows.Text = Utils.DetailsAgencyschemeGridNumberRow.ToString();
            }
            gvAgencyschemesItem.DataSource = lAgencySchemeItem;
            gvAgencyschemesItem.DataBind();
            Utils.AppendScript( "location.href='#agencies';" );
        }
        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();
        }
예제 #9
0
        private void BindData()
        {
            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);

            if (hdnViewMode.Value == "Concept")
            {
                List<ISTAT.Entity.Concept> lItem = eMapper.GetConceptList(_sdmxObjects);

                gvConcepts.PageSize = 12;
                gvConcepts.DataSourceID = null;
                gvConcepts.DataSource = lItem;
                gvConcepts.DataBind();
            }
            else
            {
                List<ISTAT.Entity.ConceptScheme> lConcept = eMapper.GetConceptSchemeList(_sdmxObjects);

                gvConceptScheme.PageSize = 12;
                gvConceptScheme.DataSourceID = null;
                gvConceptScheme.DataSource = lConcept;
                gvConceptScheme.DataBind();
            }
        }
 private List<ISTAT.Entity.HierarchicalCodelist> GetHclList()
 {
     EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);
     return eMapper.GetHclList(_sdmxObjects, Utils.LocalizedLanguage);
 }
        private void BindData()
        {
            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);

            List<ISTAT.Entity.KeyFamily> lDsd = eMapper.GetKeyFamilyList(_sdmxObjects);

            gvDSD.PageSize = 35;
            gvDSD.DataSourceID = null;
            gvDSD.DataSource = lDsd;
            gvDSD.DataBind();
        }
        private void BindData()
        {
            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);

            List<ISTAT.Entity.CodeList> lCodeList = eMapper.GetCodeListList(_sdmxObjects,  Utils.LocalizedLanguage);

            lCodeList = lCodeList.FindAll(i => !(new List<string> { "SDMX_H_PERIODS", "SDMX_M_PERIODS", "SDMX_Q_PERIODS" }.Contains(i.ID)));

            int numberOfRows = 0;

            if ( !txtNumberOfRows.Text.Trim().Equals( string.Empty ) && int.TryParse( txtNumberOfRows.Text, out numberOfRows ) )
            {
                gridView.PageSize = numberOfRows;
            }
            else
            {
                gridView.PageSize = Utils.GeneralCodelistGridNumberRow;
            }

            lblNumberOfTotalElements.Text = string.Format( Resources.Messages.lbl_number_of_total_rows, lCodeList.Count.ToString() );
            gridView.DataSourceID = null;
            gridView.DataSource = lCodeList;
            gridView.DataBind();

            if ( lCodeList.Count == 0 )
            {
                txtNumberOfRows.Visible = false;
                lblNumberOfRows.Visible = false;
                btnChangePaging.Visible = false;
            }
            else
            {
                txtNumberOfRows.Visible = true;
                lblNumberOfRows.Visible = true;
                btnChangePaging.Visible = true;
            }
        }
        private void FillForm()
        {
            ISdmxObjects sdmxCS;

            try
            {
                sdmxCS = _wsModel.GetAllCategoryScheme(true);
            }
            catch (Exception ex)
            {
                if (ex.Message.ToLower().Equals("no results found"))
                {
                    ShowDialog("No CategoryScheme Found!");
                    btnView.Enabled = false;
                }
                else
                    ShowDialog(ex.Message);
                return;
            }

            EntityMapper emCS = new EntityMapper();

            if (sdmxCS != null && sdmxCS.CategorySchemes.Count > 0)
            {
                foreach (ICategorySchemeObject cso in sdmxCS.CategorySchemes)
                {
                    cmbCategorySchemes.Items.Add(cso.Id + "," + cso.AgencyId + "," + cso.Version);
                }

                if (_artIdentity != null)
                    cmbCategorySchemes.SelectedValue = _artIdentity.ToString();
                else if (!_config.EnableCategoryDropDownList)
                {
                    cmbCategorySchemes.SelectedValue = new ArtefactIdentity(_config.DefaultCategoryScheme.Id, _config.DefaultCategoryScheme.Agency, _config.DefaultCategoryScheme.Version).ToString();
                    cmbCategorySchemes.Enabled = false;
                }
            }

            chkCodelist.Visible = _config.ArtefactFilterList.EnableCodelist;
            chkConcSchema.Visible = _config.ArtefactFilterList.EnableConceptScheme;
            chkDataflow.Visible = _config.ArtefactFilterList.EnableDataFlow;
            chkDSD.Visible = _config.ArtefactFilterList.EnableDsd;

            string[] resources = Directory.GetFiles(Server.MapPath("~/App_GlobalResources"), "*.resx");

            Utils.PopulateCmbLanguages(cmbLanguage, AVAILABLE_MODES.MODE_FOR_GLOBAL_LOCALIZATION, resources);
        }
        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();
        }
        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;
        }
예제 #16
0
        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;
        }
        private void BindData()
        {
            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);

            List<ISTAT.Entity.ContentConstraint> lContConstr = eMapper.GetContentConstraintList(_sdmxObjects, Utils.LocalizedLanguage);

            if (lContConstr == null)
            {
                Utils.ShowDialog(Resources.Messages.msg_no_result_found);
                return;
            }

            gridView.PageSize = Utils.GeneralContentConstraintNumberRow;
            gridView.DataSourceID = null;
            int numberOfRows = 0;

            if ( !txtNumberOfRows.Text.Trim().Equals( string.Empty ) && int.TryParse( txtNumberOfRows.Text, out numberOfRows ) )
            {
                gridView.PageSize = numberOfRows;
            }

            gridView.DataSource = lContConstr;
            gridView.DataBind();

            if ( lContConstr.Count == 0 )
            {
                txtNumberOfRows.Visible = false;
                lblNumberOfRows.Visible = false;
                btnChangePaging.Visible = false;
            }
            else
            {
                txtNumberOfRows.Visible = true;
                lblNumberOfRows.Visible = true;
                btnChangePaging.Visible = true;
            }
        }
        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();
        }
예제 #19
0
        private void BindData()
        {
            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);

            List<ISTAT.Entity.CodeList> lCodeList = eMapper.GetCodeListList(_sdmxObjects);

            gvCodelists.PageSize = 12;
            gvCodelists.DataSourceID = null;
            gvCodelists.DataSource = lCodeList;
            gvCodelists.DataBind();
        }
        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();
        }
        protected void btnChangePaging_Click(object sender, EventArgs e)
        {
            IOrganisationUnitSchemeMutableObject ous = GetOrganizationUnitSchemeFromSession();

            if (ous == null) return;

            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);
            List<ISTAT.Entity.OrganizationUnitScheme> lOrganizationUnitscheme = eMapper.GetOrganizationUnitSchemeList(_sdmxObjects);
            IList<OrganizationUnit> lOrganizationUnitSchemeItem = new List<OrganizationUnit>();

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

            int numberOfRows = 0;

            if ( !txtNumberOfRows.Text.Trim().Equals( string.Empty ) && int.TryParse( txtNumberOfRows.Text, out numberOfRows ) )
            {
                if ( numberOfRows > 0 )
                {
                    gvOrganizationunitschemesItem.PageSize = numberOfRows;
                }
                else
                {
                    gvOrganizationunitschemesItem.PageSize = Utils.DetailsOrganizationUnitSchemeGridNumberRow;
                    txtNumberOfRows.Text = Utils.DetailsOrganizationUnitSchemeGridNumberRow.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='#organizationunits';" );
                return;
            }
            else if ( txtNumberOfRows.Text.Trim().Equals( string.Empty ) )
            {
                gvOrganizationunitschemesItem.PageSize = Utils.DetailsOrganizationUnitSchemeGridNumberRow;
                txtNumberOfRows.Text = Utils.DetailsOrganizationUnitSchemeGridNumberRow.ToString();
            }
            gvOrganizationunitschemesItem.DataSource = lOrganizationUnitSchemeItem;
            gvOrganizationunitschemesItem.DataBind();
            Utils.AppendScript( "location.href='#organizationunits';" );
        }
        private void BindData()
        {
            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);

            List<ISTAT.Entity.DataFlow> lDF = eMapper.GetDataFlowList(_sdmxObjects);

            gvDataFlow.PageSize = 35;
            gvDataFlow.DataSourceID = null;
            gvDataFlow.DataSource = lDF;
            gvDataFlow.DataBind();
        }
        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 OnSorting(object sender, GridViewSortEventArgs e)
        {
            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);
            List<ISTAT.Entity.OrganizationUnitScheme> _list = eMapper.GetOrganizationUnitSchemeList(_sdmxObjects);

            if ((SortDirection)ViewState["SortExpr"] == SortDirection.Ascending)
            {
                _list = _list.OrderBy(x => TypeHelper.GetPropertyValue(x, e.SortExpression)).Reverse().ToList();
                ViewState["SortExpr"] = SortDirection.Descending;
            }
            else
            {
                _list = _list.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 ) )
            {
                gridView.PageSize = numberOfRows;
            }
            else
            {
                gridView.PageSize = Utils.GeneralOrganizationUnitSchemeGridNumberRow;
            }
            gridView.DataSourceID = null;
            gridView.DataSource = _list;
            gridView.DataBind();
        }
        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'" );
        }
        private void BindData()
        {
            EntityMapper eMapper = new EntityMapper(Utils.LocalizedLanguage);

            if (hdnViewMode.Value == "Concept")
            {
                List<ISTAT.Entity.Concept> lItem = eMapper.GetConceptList(_sdmxObjects);
                List<ISTAT.Entity.Concept> lFilteredItem;

                if (txtSearchID.Text.Trim() != String.Empty || txtSearchName.Text.Trim() != String.Empty)
                {
                    lFilteredItem = lItem.Where(i => i.Code.ToUpper().Contains(txtSearchID.Text.Trim().ToUpper()) || txtSearchID.Text.Trim() == String.Empty).ToList();
                    lFilteredItem = lFilteredItem.Where(i => i.Name.ToUpper().Contains(txtSearchName.Text.Trim().ToUpper()) || txtSearchName.Text.Trim() == String.Empty).ToList();
                }
                else
                    lFilteredItem = lItem;

                gvConcepts.PageSize = 35;
                gvConcepts.DataSourceID = null;
                gvConcepts.DataSource = lFilteredItem;
                gvConcepts.DataBind();
            }
            else
            {
                List<ISTAT.Entity.ConceptScheme> lConcept = eMapper.GetConceptSchemeList(_sdmxObjects);

                gvConceptScheme.PageSize = 12;
                gvConceptScheme.DataSourceID = null;
                gvConceptScheme.DataSource = lConcept;
                gvConceptScheme.DataBind();
            }
        }