Exemplo n.º 1
0
 SynTableData DoLoadGrid(SynTableData data)
 {
     try
     {
         var newdata = m_synItem.GetGridData(MainForm.SourceDb, MainForm.TargetDb, data, false);
         m_grids[(int)data] = newdata;
     }
     catch (Exception err)
     {
         Errors.Report(err);
     }
     return(data);
 }
Exemplo n.º 2
0
 private void TestGridTab_LoadGrid(TabPage page, SynTableData data, TableDataFrame grid)
 {
     if (tabControl1.SelectedTab == page)
     {
         if (AvailableCompareInfo)
         {
             var table = m_synItem.GetGridData(null, null, data, true);
             if (table != null)
             {
                 grid.TabularData = table;
             }
             else
             {
                 page.Controls.ShowProgress(true);
                 m_loadGrid.BeginInvoke(data, m_invoker.CreateInvokeCallback(LoadedGrid), null);
             }
         }
         else
         {
             tabControl1.SelectedTab = tabSourceAndTarget;
         }
     }
 }
Exemplo n.º 3
0
        public GridTable GetGridData(IDatabaseSource sourcedb, IDatabaseSource targetdb, SynTableData data, bool denyLoad)
        {
            if (m_grids[(int)data] == null && !denyLoad)
            {
                m_gridSourceConn = sourcedb;
                m_gridTargetConn = targetdb;

                switch (data)
                {
                case SynTableData.OnlyInSource:
                    m_gridFills[(int)data] = new GridTable(m_srcInfo.GetTableStructure(SynQueryType.SelectAll), sourcedb.ToString());
                    break;

                case SynTableData.OnlyInTarget:
                    m_gridFills[(int)data] = new GridTable(m_dstInfo.GetTableStructure(SynQueryType.SelectAll), targetdb.ToString());
                    break;

                case SynTableData.Equal:
                    m_gridFills[(int)data] = new GridTable(m_srcInfo.GetTableStructure(SynQueryType.SelectAll), sourcedb.ToString());
                    break;

                case SynTableData.Modified:
                    var ts = new TableStructure();
                    m_srcInfo.FillKey(ts);
                    m_srcInfo.FillDataColumns(ts);
                    m_dstInfo.FillDataColumns(ts);

                    for (int i = 0; i < m_srcInfo.KeyCols.Length; i++)
                    {
                        var col = (ColumnStructure)ts.Columns[i];
                        col.ColumnName = "K-" + col.ColumnName;
                    }
                    for (int i = 0; i < m_srcInfo.DataCols.Length; i++)
                    {
                        var col = (ColumnStructure)ts.Columns[i + m_srcInfo.KeyCols.Length];
                        col.ColumnName = "1-" + col.ColumnName;
                    }
                    for (int i = 0; i < m_dstInfo.DataCols.Length; i++)
                    {
                        var col = (ColumnStructure)ts.Columns[i + m_srcInfo.KeyCols.Length + m_srcInfo.DataCols.Length];
                        col.ColumnName = "2-" + col.ColumnName;
                    }

                    m_gridFills[(int)data] = new GridTable(ts, sourcedb.ToString());
                    break;
                }
                try
                {
                    ProcessFootprints();
                    m_grids[(int)data] = m_gridFills[(int)data];
                }
                finally
                {
                    m_gridFills[(int)data] = null;
                    m_gridSourceConn       = null;
                    m_gridTargetConn       = null;
                }
            }
            return(m_grids[(int)data]);
        }