Esempio n. 1
0
        public static RegNameList <ListTabSheet> CreateTabSheets(this CodeTable codeTable,
                                                                 TkDbContext context, IFieldInfo field)
        {
            DataSet ds = new DataSet()
            {
                Locale = ObjectUtil.SysCulture
            };

            using (ds)
            {
                codeTable.Fill(ds, context);
                if (ds.Tables.Count == 0)
                {
                    return(null);
                }
                DataTable table = ds.Tables[0];
                if (table.Rows.Count == 0)
                {
                    return(null);
                }

                RegNameList <ListTabSheet> result = new RegNameList <ListTabSheet>();
                foreach (DataRow row in table.Rows)
                {
                    object        value   = row[DecoderConst.CODE_NICK_NAME];
                    IParamBuilder builder = SqlParamBuilder.CreateEqualSql(context, field,
                                                                           value);
                    ListTabSheet tab = new ListTabSheet(value.ToString(),
                                                        row[DecoderConst.NAME_NICK_NAME].ToString(), builder);
                    result.Add(tab);
                }

                return(result);
            }
        }
Esempio n. 2
0
 public MultipleCodeTable(CodeTable codeTable)
 {
     TkDebug.AssertArgumentNull(codeTable, "codeTable", null);
     fCodeTable = codeTable;
 }