Пример #1
0
        ///<summary>
        ///构建数据库模型
        ///</summary>
        protected override void BuildDataSet()
        {
            this.DataSet = new DataSet();
            DataTable table = new DataTable(tableName);

            //构建表结构
            DataSourceHelper.AddColumn(new DefineField(table, "TYPEID", "单据类型代码", FieldSize.Size50)
            {
                DataType = LibDataType.Text, AllowCopy = false, AllowEmpty = false
            });
            DataSourceHelper.AddColumn(new DefineField(table, "TYPENAME", "单据类型名称", FieldSize.Size20)
            {
                DataType = LibDataType.NText, AllowEmpty = false
            });
            DataSourceHelper.AddDefaultCreateState(table);
            DataSourceHelper.AddFixColumn(table, this.BillType);
            table.PrimaryKey = new DataColumn[] { table.Columns["TYPEID"] };
            this.DataSet.Tables.Add(table);
        }