public bool EditeProprietes(IObjetDeEasyQuery objet)
        {
            CODEQTableFromBase tableFromBase = objet as CODEQTableFromBase;

            if (tableFromBase == null)
            {
                return(false);
            }
            CFormEditeProprietesTableFromBase form = new CFormEditeProprietesTableFromBase();

            form.Init(tableFromBase);
            bool bResult = form.ShowDialog() == DialogResult.OK;

            form.Dispose();
            return(bResult);
        }
Example #2
0
        //-----------------------------------------------------------------
        public bool EditeProprietes(I2iObjetGraphique objet)
        {
            IObjetDeEasyQuery objetDeQuery = objet as IObjetDeEasyQuery;

            if (objetDeQuery == null)
            {
                return(false);
            }
            Type tpEditeur = GetTypeEditeurForObjet(objetDeQuery);

            if (tpEditeur == null)
            {
                return(false);
            }
            IEditeurProprietesObjetDeEasyQuery editeur = Activator.CreateInstance(tpEditeur) as IEditeurProprietesObjetDeEasyQuery;
            bool bResult = false;

            if (editeur != null)
            {
                bResult = editeur.EditeProprietes(objetDeQuery);
            }
            if (editeur is IDisposable)
            {
                ((IDisposable)editeur).Dispose();
            }
            if (bResult)
            {
                CEasyQuery query = ObjetEdite as CEasyQuery;
                if (query != null && query.ListeSources != null)
                {
                    CODEQTableFromBase odeqFromBase = objetDeQuery as CODEQTableFromBase;
                    if (odeqFromBase != null && odeqFromBase.TableDefinition != null)
                    {
                        query.ListeSources.ClearCache(odeqFromBase.TableDefinition);
                    }
                }
                Refresh();
                if (ElementPropertiesChanged != null)
                {
                    ElementPropertiesChanged(objetDeQuery, null);
                }
            }
            return(bResult);
        }
        public void Init(CODEQTableFromBase obj)
        {
            m_tableFromBase = obj;
            if (m_tableFromBase.TableDefinition != null)
            {
                m_lblSource.Text = m_tableFromBase.TableDefinition.TableName;
            }
            else
            {
                m_lblSource.Text = "?";
            }
            m_txtNomTable.Text    = m_tableFromBase.NomFinal;
            m_chkUseCache.Checked = m_tableFromBase.UseCache;
            FillListeColonnes();
            FillListeFormulesNommees();
            if (m_controleOptions != null)
            {
                m_pageOptions.Control = null;
                m_controleOptions.Dispose();
            }
            m_controleOptions = null;

            m_controleOptions = CAllocateurControleOptionTableDefinition.GetControleOptions(obj.TableDefinition);
            if (m_controleOptions == null)
            {
                if (m_tabControl.TabPages.Contains(m_pageOptions))
                {
                    m_tabControl.TabPages.Remove(m_pageOptions);
                }
            }
            else
            {
                if (!m_tabControl.TabPages.Contains(m_pageOptions))
                {
                    m_tabControl.TabPages.Add(m_pageOptions);
                }
                m_pageOptions.Control = (Control)m_controleOptions;
                m_controleOptions.FillFromTable(m_tableFromBase.TableDefinition);
            }
            CCAMLQuery query = obj.CAMLQuery;

            if (query == null)
            {
                query = new CCAMLQuery();
            }
            IEnumerable <CCAMLItemField>   fields    = null;
            ITableDefinitionRequetableCAML tableCAML = obj.TableDefinition as ITableDefinitionRequetableCAML;

            if (tableCAML != null)
            {
                fields = tableCAML.CAMLFields;
            }
            else
            {
                if (obj.TableDefinition != null)
                {
                    fields = obj.CAMLFields;
                }
                else
                {
                    fields = new List <CCAMLItemField>();
                }
            }
            m_panelCAML.Init(m_tableFromBase.Query, query, fields);

            m_panelPostFilter.Init(obj);
        }