Ejemplo n.º 1
0
        private void refreshTables()
        {
            var lst = TableWorkspaceList.GetTableWorkspaces(_generatorHelper);

            gridTables.AutoGenerateColumns = false;
            gridTables.DataSource          = new BindingList <TableWorkspace>(lst.Workspaces.OrderBy(w => w.Table.ToString()).ToList());
        }
Ejemplo n.º 2
0
        private void refreshTables()
        {
            var lst = TableWorkspaceList.GetTableWorkspaces(_compareHelper, true, false);

            TargetTable.Items.Clear();
            TargetTable.Items.Add(string.Empty);
            var toTbls = from s in _compareHelper.ToDataSource.CurrentDatabase.Schemas
                         from t in s.Tables
                         select t;

            TargetTable.Items.AddRange(toTbls.OrderBy(t => t.TableName).ToArray());


            gridTables.AutoGenerateColumns = false;

            if (gridTables.DataSource != null)
            {
                var currws = (gridTables.DataSource as BindingList <TableWorkspace>).ToList();
                foreach (var curr in currws)
                {
                    var newws = lst.Workspaces.FirstOrDefault(ws => ws.SourceObject.ToString() == curr.SourceObject.ToString());
                    if (newws != null)
                    {
                        if (curr.Select)
                        {
                            newws.Select = curr.Select;
                        }
                        if (curr.SelectTableForData)
                        {
                            newws.SelectTableForData = curr.SelectTableForData;
                        }
                        if (curr.Delete)
                        {
                            newws.Delete = curr.Delete;
                        }
                        if (curr.KeepIdentity)
                        {
                            newws.KeepIdentity = curr.KeepIdentity;
                        }
                        if (curr.RemoveAddIndexes)
                        {
                            newws.RemoveAddIndexes = curr.RemoveAddIndexes;
                        }
                        if (curr.RemoveAddKeys)
                        {
                            newws.RemoveAddKeys = curr.RemoveAddKeys;
                        }
                        if (curr.Truncate)
                        {
                            newws.Truncate = curr.Truncate;
                        }
                    }
                }
            }

            gridTables.DataSource = new BindingList <TableWorkspace>(
                lst.Workspaces
                .Where(ws => ws.TargetTable != null)
                .OrderBy(w => w.SourceTable.ToString()).ToList());
        }
Ejemplo n.º 3
0
        private void refreshTables(List <DropWorkspace> dropWorkspaces)
        {
            var lst = TableWorkspaceList.GetTableWorkspaces(_compareHelper);

            foreach (var dw in lst.DropWorkspaces)
            {
                dropWorkspaces.Add(dw);
            }

            TargetTable.Items.Clear();
            TargetTable.Items.Add(string.Empty);
            var toTbls = from s in _compareHelper.ToDatabase.Schemas
                         from t in s.Tables
                         select t;

            TargetTable.Items.AddRange(toTbls.OrderBy(t => t.TableName).ToArray());


            gridTables.AutoGenerateColumns = false;
            gridTables.DataSource          = new BindingList <TableWorkspace>(lst.Workspaces.OrderBy(w => w.SourceTable.ToString()).ToList());
        }