public SelectOperation(IExecutionPlanOperation predecessor, Selection selection)
        {
            Predecessor = predecessor;
            this.selection = selection;
            this.metadata = Predecessor.GetMetadata();

            log4net.Config.XmlConfigurator.Configure();
            log = LogManager.GetLogger("ExecutionPlan");
        }
示例#2
0
        private ICollection<Selection> GetSelections()
        {
            var selections = new List<Selection>();

            var tableSelections = new Dictionary<string, List<string>>();

            for (int i = 0; i < selectDataGridView.Rows.Count - 1; i++)
            {
                var tableName = selectDataGridView.Rows[i].Cells[0].Value.ToString();
                var columnName = selectDataGridView.Rows[i].Cells[1].Value.ToString();

                if (!tableSelections.ContainsKey(tableName))
                {
                    tableSelections.Add(tableName, new List<string>());
                }
                tableSelections[tableName].Add(columnName);
            }

            foreach (var tableAsKey in tableSelections.Keys)
            {
                var selection = new Selection(tableAsKey, tableSelections[tableAsKey]);
                selections.Add(selection);
            }

            return selections;
        }