//--------------------------------------------------------
 private void m_wndAddColumn_LinkClicked(object sender, EventArgs e)
 {
     CDefinitionProprieteDynamique[] defs = CFormSelectChampPourStructure.SelectProprietes
                                            (
         m_tableFromFramework.TypeSource,
         CFormSelectChampPourStructure.TypeSelectionAttendue.ChampParent |
         CFormSelectChampPourStructure.TypeSelectionAttendue.ChampFille |
         CFormSelectChampPourStructure.TypeSelectionAttendue.UniquementElementDeBaseDeDonnees |
         CFormSelectChampPourStructure.TypeSelectionAttendue.InclureChampsCustom,
         null);
     // Créé le nouveau champ de requete
     foreach (CDefinitionProprieteDynamique def in defs)
     {
         CColumnDeEasyQueryChampDeRequete champUnique = new CColumnDeEasyQueryChampDeRequete();
         champUnique.NomChamp = def.Nom;
         champUnique.TypeDonneeAvantAgregation = def.TypeDonnee.TypeDotNetNatif;
         champUnique.OperationAgregation       = OperationsAgregation.None;
         champUnique.GroupBy = false;
         List <CSourceDeChampDeRequete> listeSources = new List <CSourceDeChampDeRequete>();
         CSourceDeChampDeRequete        source       = new CSourceDeChampDeRequete(def.NomChampCompatibleCComposantFiltreChamp);
         listeSources.Add(source);
         champUnique.Sources = listeSources.ToArray();
         ListViewItem item = new ListViewItem(champUnique.NomChamp);
         item.Tag = champUnique;
         m_wndListeColonnes.Items.Add(item);
     }
 }
 public void Init(
     CSourceDeChampDeRequete source,
     int nIndex,
     Type typeSource,
     CDefinitionProprieteDynamique definitionRacineDeChamps)
 {
     m_nIndex                   = nIndex;
     m_lblNumero.Text           = "@" + (nIndex + 1);
     m_lblSource.Text           = source.Source;
     m_source                   = source;
     m_definitionRacineDeChamps = definitionRacineDeChamps;
     m_typeSource               = typeSource;
 }
 //---------------------------------------------------
 public CColumnDeEasyQueryChampDeRequete(
     string strNomChampFinal,
     CSourceDeChampDeRequete source,
     Type typeDonneeAvantAgregation,
     OperationsAgregation operation,
     bool bGroupBy)
     : base(strNomChampFinal,
            source,
            typeDonneeAvantAgregation,
            operation,
            bGroupBy)
 {
     m_strId = Guid.NewGuid().ToString();
 }
Exemple #4
0
        //-------------------------------------------------------------------------
        private void OnAddChampCumule()
        {
            if (!(m_tableExportCumulee is C2iTableExportCumulee))
            {
                return;
            }

            Type tp = m_structureExport.TypeSource;
            C2iTableExportCumulee table = (C2iTableExportCumulee)m_tableExportCumulee;

            if (m_tableExportCumulee != null && table.ChampOrigine != null)
            {
                tp = table.ChampOrigine.TypeDonnee.TypeDotNetNatif;
            }
            CDefinitionProprieteDynamique[] defs = CFormSelectChampPourStructure.SelectProprietes
                                                   (
                tp,
                CFormSelectChampPourStructure.TypeSelectionAttendue.ChampParent |
                CFormSelectChampPourStructure.TypeSelectionAttendue.ChampFille |
                CFormSelectChampPourStructure.TypeSelectionAttendue.UniquementElementDeBaseDeDonnees |
                CFormSelectChampPourStructure.TypeSelectionAttendue.InclureChampsCustom,
                table.ChampOrigine);


            // Créé le nouveau champ de requete
            if (defs.Length > 0)
            {
                C2iChampDeRequete             champUnique = new C2iChampDeRequete();
                CDefinitionProprieteDynamique def1        = defs[0];
                champUnique.NomChamp = def1.Nom;
                champUnique.TypeDonneeAvantAgregation = def1.TypeDonnee.TypeDotNetNatif;

                List <CSourceDeChampDeRequete> listeSources = new List <CSourceDeChampDeRequete>();
                foreach (CDefinitionProprieteDynamique def in defs)
                {
                    CSourceDeChampDeRequete source = new CSourceDeChampDeRequete(def.NomChampCompatibleCComposantFiltreChamp);
                    listeSources.Add(source);
                }
                champUnique.Sources = listeSources.ToArray();
                ListViewItem item = new ListViewItem();
                m_wndListeChamps.Items.Add(item);
                if (champUnique != null && EditChamp(champUnique))
                {
                    FillItemForChamp(item, champUnique);
                }
            }
        }
 private void m_btnSelect_Click(object sender, System.EventArgs e)
 {
     CDefinitionProprieteDynamique[] defs = CFormSelectChampPourStructure.SelectProprietes
                                            (
         m_typeSource,
         CFormSelectChampPourStructure.TypeSelectionAttendue.ChampParent |
         CFormSelectChampPourStructure.TypeSelectionAttendue.ChampFille |
         CFormSelectChampPourStructure.TypeSelectionAttendue.UniquementElementDeBaseDeDonnees |
         CFormSelectChampPourStructure.TypeSelectionAttendue.InclureChampsCustom,
         m_definitionRacineDeChamps);
     if (defs.Length > 0)
     {
         CSourceDeChampDeRequete source = new CSourceDeChampDeRequete(defs[0].NomChampCompatibleCComposantFiltreChamp);
         m_lblSource.Text = source.Source;
         m_source         = source;
     }
 }
        private void m_lnkAjouterSource_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
        {
            CSourceDeChampDeRequete source = new CSourceDeChampDeRequete("");
            CPanelSourceDeRequete   panel  = new CPanelSourceDeRequete();

            panel.Dock = DockStyle.Top;
            m_panelSources.Controls.Add(panel);
            panel.BringToFront();

            // Initialise le nouveau control avec l'index incrémenté de 1
            int nIndexControls = m_panelSources.Controls.Count;

            panel.Init(
                source,
                nIndexControls > 0 ? nIndexControls - 1  : 0,
                m_typeSource,
                m_defRacineDeChamps);
            panel.Focus();
        }
 private void m_btnPlusRien_Click(object sender, System.EventArgs e)
 {
     m_source         = null;
     m_lblSource.Text = "";
 }