//-------------------------------------------------------------------
        private void InitChamps()
        {
            m_extLinkField.FillDialogFromObjet(m_typeEntite);
            m_txtFormuleIndex.Init(new CFournisseurGeneriqueProprietesDynamiques(),
                                   new CObjetPourSousProprietes(m_typeEntite.GetEntiteDeTest()));
            m_txtFormuleIndex.Formule = m_typeEntite.FormuleIndexParDefaut;
            m_txtFormuleLibelle.Init(new CFournisseurGeneriqueProprietesDynamiques(),
                                     new CObjetPourSousProprietes(m_typeEntite.GetEntiteDeTest()));
            m_txtFormuleLibelle.Formule = m_typeEntite.FormuleLibelle;

            /*m_panelFormulaire.Init(typeof(CEntiteSnmpPourSupervision),
             *  m_typeEntite.GetEntiteDeTest(),
             *  m_typeEntite.Formulaire,
             *  new CFournisseurGeneriqueProprietesDynamiques());*/
            m_cmbModeGestion.Items.Clear();
            foreach (EModeGestionEntiteAgent mode in Enum.GetValues(typeof(EModeGestionEntiteAgent)))
            {
                m_cmbModeGestion.Items.Add(mode);
            }
            m_cmbModeGestion.SelectedItem = m_typeEntite.ModeGestion;

            m_lnkEditSourceQuery.Visible = m_typeEntite.IdObjetDeQuerySource != "";

            UpdateLabelSource();

            FillListeChamps();
        }
        //--------------------------------------
        private void InitChamps()
        {
            m_txtNomChamp.Text       = m_champEdite.NomChamp;
            m_txtDescription.Text    = m_champEdite.Description;
            m_lblDataType.Text       = new CTypeChampBasique(m_champEdite.TypeChamp).Libelle;
            m_chkNoUpdate.Checked    = m_champEdite.NoUpdateFromSnmp;
            m_chkNoWriteSNMP.Checked = m_champEdite.IsReadOnly;
            m_lblAcces.Text          = m_champEdite.IsReadOnly ? I.T("Read only|20296") : I.T("Read/write|20297");

            CFournisseurGeneriqueProprietesDynamiques fournisseur = new CFournisseurGeneriqueProprietesDynamiques();
            CEntiteSnmpPourSupervision entiteTest = m_typeEntite.GetEntiteDeTest();

            m_txtFormuleIndex.Init(fournisseur,
                                   new CObjetPourSousProprietes(entiteTest));
            m_txtFormuleIndex.Formule = m_champEdite.FormuleIndex;

            TypeDonnee typeChampMap = TypeDonnee.tString;

            switch (m_champEdite.TypeChamp)
            {
            case ETypeChampBasique.Bool:
                typeChampMap = TypeDonnee.tBool;
                break;

            case ETypeChampBasique.Date:
                typeChampMap = TypeDonnee.tDate;
                break;

            case ETypeChampBasique.Decimal:
                typeChampMap = TypeDonnee.tDouble;
                break;

            case ETypeChampBasique.Int:
                typeChampMap = TypeDonnee.tEntier;
                break;

            case ETypeChampBasique.String:
                typeChampMap = TypeDonnee.tString;
                break;

            default:
                break;
            }
            m_txtSelectChampCustom.InitAvecFiltreDeBase(typeof(CChampCustom),
                                                        "Nom",
                                                        CFiltreData.GetAndFiltre(CChampCustom.GetFiltreChampsForRole(CEntiteSnmp.c_roleChampCustom),
                                                                                 new CFiltreData(CChampCustom.c_champType + "=@1",
                                                                                                 (int)typeChampMap)),
                                                        false);
            CChampCustom champ = new CChampCustom(m_contexteDonnee);

            if (m_champToCustom.IdChampCustom != null && champ.ReadIfExists(m_champToCustom.IdChampCustom.Value))
            {
                m_txtSelectChampCustom.ElementSelectionne = champ;
            }
            else
            {
                m_txtSelectChampCustom.ElementSelectionne = null;
            }
        }
Example #3
0
        //--------------------------------------
        private void InitChamps()
        {
            m_txtNomChamp.Text    = m_champEdite.NomChamp;
            m_txtDescription.Text = m_champEdite.Description;
            m_lblDataType.Text    = new CTypeChampBasique(m_champEdite.TypeChamp).Libelle;
            m_lblAcces.Text       = m_champEdite.IsReadOnly ? I.T("Read only|20101") : I.T("Read/write|20102");

            CFournisseurGeneriqueProprietesDynamiques fournisseur = new CFournisseurGeneriqueProprietesDynamiques();
            CEntiteSnmpPourSupervision entiteTest = m_typeEntite.GetEntiteDeTest();

            m_txtFormuleIndex.Init(fournisseur,
                                   new CObjetPourSousProprietes(entiteTest));
            m_txtFormuleIndex.Formule = m_champEdite.FormuleIndex;
        }