Beispiel #1
0
        public static void ShowTable(
            string strInfoRequete,
            DataTable table)
        {
            CFormVisuTable form = new CFormVisuTable();

            form.Text = strInfoRequete;
            form.m_grid.DataSource = table;
            form.m_lblRequete.Text = strInfoRequete;
            form.Show();
        }
Beispiel #2
0
        //-------------------------------------------------------
        private void m_mnuVoirTable_Click(object sender, EventArgs e)
        {
            IDefinition definition = GetCurrent();

            if (definition != null)
            {
                if (m_connexion == null)
                {
                    if (!SetupConnexion())
                    {
                        return;
                    }
                }
                CResultAErreurType <DataTable> result = m_connexion.GetTable(definition.GetNumericalForm());
                if (!result)
                {
                    CFormAfficheErreur.Show(result.Erreur);
                }
                else
                {
                    DataTable   table = result.DataType;
                    IObjectTree tree  = definition.Tree;
                    if (tree != null)
                    {
                        foreach (DataColumn col in table.Columns)
                        {
                            try
                            {
                                uint[]      oid = ObjectIdentifier.Convert(col.ColumnName);
                                IDefinition def = tree.Find(oid);
                                if (def != null)
                                {
                                    col.ColumnName = def.Name;
                                }
                            }
                            catch
                            {
                            }
                        }
                    }

                    CFormVisuTable.ShowTable("Table " + definition.Name, result.DataType);
                }
            }
        }