예제 #1
0
        protected static string[] GetColumns(DataSqlGeneratorColumnSet colset, ITableStructure ts, string[] selcolumns)
        {
            switch (colset.Mode)
            {
            case DataSqlGeneratorColumnSet.ModeEnum.AllColumns:
                return(ts.Columns.GetNames());

            case DataSqlGeneratorColumnSet.ModeEnum.ExplicitColumns:
                return(colset.Columns.ToArray());

            case DataSqlGeneratorColumnSet.ModeEnum.NoPkCols:
                return(ts.GetNoPkColumnNames());

            case DataSqlGeneratorColumnSet.ModeEnum.PrimaryKey:
                return(ts.GetPkColumnNames());

            case DataSqlGeneratorColumnSet.ModeEnum.SelectedColumns:
                return(selcolumns);

            case DataSqlGeneratorColumnSet.ModeEnum.NoSelectedColumns:
            {
                var res = new List <string>();
                foreach (string col in ts.Columns.GetNames())
                {
                    if (Array.IndexOf(selcolumns, col) <= 0)
                    {
                        res.Add(col);
                    }
                }
                return(res.ToArray());
            }
            }
            return(null);
        }
예제 #2
0
        public override void InitializeMode(DataSqlGeneratorColumnSet.ModeEnum value)
        {
            switch (value)
            {
            case DataSqlGeneratorColumnSet.ModeEnum.AllColumns:
                SetChecked(m_table.Columns.GetNames());
                break;

            case DataSqlGeneratorColumnSet.ModeEnum.NoPkCols:
                SetChecked(m_table.GetNoPkColumnNames());
                break;

            case DataSqlGeneratorColumnSet.ModeEnum.PrimaryKey:
                SetChecked(m_table.GetPkColumnNames());
                break;

            case DataSqlGeneratorColumnSet.ModeEnum.SelectedColumns:
                SetChecked(m_selcolumns);
                break;
            }
        }