用户登录
用户注册

分享至

codesmith 模板 大全

  • 作者: 简简单单单
  • 来源: 51数据库
  • 2020-09-24
CREATE TABLE datatype ( id int IDENTITY(1,1) PRIMARY KEY NOT NULL,--主键 updatetime datetime default(getdate()),--更新时间 userid int,--操作人 isdelete int ,--删除标示 0 表示正常 1表示删除 typename varchar(200),--部门名称 typeid int,--部门id )GO这是建库 代码



  int id = 0; DateTime updatetime = DateTime.Now; int userid = 0; int isdelete = 0; string typename = ""; int typeid = 0;如何赋值?



  这是模板 存成*.cst格式<%@ CodeTemplate Language="C#" TargetLanguage="C#" Src="ToolsCodeTemplate.cs" Inherits="ToolsCodeTemplate"%><%@ Property Name="TargetTable" Type="SchemaExplorer.TableSchema" Category="Context" Description="TargetTable that the object is based on." %><%@ Property Name="ModelsNamespace" Default="MyOffice.Models" Type="System.String" Category="Context" Description="TargetTable that the object is based on." %><%@ Assembly Name="SchemaExplorer" %><%@ Assembly Name="System.Data" %><%@ Import Namespace="SchemaExplorer" %><%@ Import Namespace="System.Data" %><% PrintHeader(); %>using System;using System.Collections.Generic;using System.Text;namespace <%= ModelsNamespace %>{ public class <%= GetModelClassName() %> { <% foreach (ColumnSchema column in TargetTable.Columns) { %> public <%= GetPropertyType(column) %> <%= GetPropertyName(column) %> <% } %> }}



  这是张树亮老师 oa课件里的一个表



  自己解决了 感谢度娘
软件
前端设计
程序设计
Java相关