My Program life
吴碧宇,Knightfire,Wubiyu,
Google Doc
博客园
首页
博问
闪存
新随笔
联系
订阅
管理
随笔-151 文章-13 评论-52
SqlBusiness.cst 商务层生成
1
<%--
2
Name:
3
Author:
4
Description:
5
--%>
6
<%
@ CodeTemplate Language
=
"
C#
"
ResponseEncoding
=
"
UTF-8
"
TargetLanguage
=
"
Text
"
Src
=
"
Helper.cs
"
Inherits
=
"
Helper
"
Debug
=
"
False
"
Description
=
"
Template description here.
"
%>
7
8
<%
@ Assembly Name
=
"
System.Data
"
%>
9
<%
@ Assembly Name
=
"
SchemaExplorer
"
%>
10
<%
@ Assembly Name
=
"
CodeSmith.BaseTemplates
"
%>
11
<%
@ Import Namespace
=
"
System.Data
"
%>
12
<%
@ Import Namespace
=
"
SchemaExplorer
"
%>
13
<%
@ Import Namespace
=
"
CodeSmith.BaseTemplates
"
%>
14
15
<%
@ Property Name
=
"
DataBase
"
Type
=
"
SchemaExplorer.DatabaseSchema
"
Category
=
"
1.数据库对象
"
Description
=
"
当前生成的数据库对象
"
%>
16
<%
@ Property Name
=
"
NameSpace
"
Type
=
"
System.String
"
Default
=
""
Optional
=
"
false
"
Category
=
""
Description
=
"
当前生成命名空间
"
%>
17
<%
@ Property Name
=
"
ModuleName
"
Type
=
"
System.String
"
Default
=
""
Optional
=
"
false
"
Category
=
""
Description
=
"
项目名称
"
%>
18
19
using
System;
20
using
System.Collections.Generic;
21
using
System.Text;
22
using
rs.ABC.Framework;
23
24
namespace
<%=
NameSpace
%>
.Business
25
{
26
public
static
class
<%=
ModuleName
%>
Manage
27
{
28
<%
29
foreach
(TableSchema Table
in
DataBase.Tables)
30
{
31
%>
32
public
static
<%
33
if
(
!
IsMorePrimary(Table))
34
{
%><%=
GetCSharpVariableType(Table.PrimaryKey.MemberColumns[
0
])
%>
<%
35
36
}
37
else
38
{
%>
void
<%
39
}
40
%>
Create
<%=
GetClassName(Table)
%>
(
<%=
GetClassName(Table)
%>
<%=
GetparameteryName(Table)
%>
)
41
{
42
<%
43
if
(
!
IsMorePrimary(Table))
44
{
%>
return
<%=
ModuleName
%>
Provider.Instance.Create
<%=
GetClassName(Table)
%>
(
<%=
GetparameteryName(Table)
%>
);
<%
45
46
}
47
else
48
{
%><%=
ModuleName
%>
Provider.Instance.Create
<%=
GetClassName(Table)
%>
(
<%=
GetparameteryName(Table)
%>
);
<%
49
}
50
%>
51
52
}
53
54
public
static
void
UpDate
<%=
GetClassName(Table)
%>
(
<%=
GetClassName(Table)
%>
<%=
GetparameteryName(Table)
%>
)
55
{
56
<%=
ModuleName
%>
Provider.Instance.Update
<%=
GetClassName(Table)
%>
(
<%=
GetparameteryName(Table)
%>
);
57
}
58
59
public
static
void
Delete
<%=
GetClassName(Table)
%>
(
<%
60
foreach
(ColumnSchema column
in
Table.PrimaryKey.MemberColumns)
61
{
62
%><%=
GetCSharpVariableType(column)
%>
<%=
GetFiledName(column)
%><%=
GetComma(column,Table.PrimaryKey.MemberColumns)
%><%
}
%>
)
63
{
64
<%=
ModuleName
%>
Provider.Instance.Delete
<%=
GetClassName(Table)
%>
(
<%
65
foreach
(ColumnSchema column
in
Table.PrimaryKey.MemberColumns)
66
{
67
%><%=
GetFiledName(column)
%><%=
GetComma(column,Table.PrimaryKey.MemberColumns)
%><%
}
%>
);
68
}
69
70
public
static
<%=
GetClassName(Table)
%>
Get
<%=
GetClassName(Table)
%>
(
<%
71
foreach
(ColumnSchema column
in
Table.PrimaryKey.MemberColumns)
72
{
73
%><%=
GetCSharpVariableType(column)
%>
<%=
GetFiledName(column)
%><%=
GetComma(column,Table.PrimaryKey.MemberColumns)
%><%
}
%>
)
74
{
75
return
<%=
ModuleName
%>
Provider.Instance.Get
<%=
GetClassName(Table)
%>
(
<%
76
foreach
(ColumnSchema column
in
Table.PrimaryKey.MemberColumns)
77
{
78
%><%=
GetFiledName(column)
%><%=
GetComma(column,Table.PrimaryKey.MemberColumns)
%><%
}
%>
);
79
}
80
<%
}
%>
81
82
83
}
84
}
85
86
87
<
script runat
=
"
template
"
>
88
89
</
script
>
绿色通道:
好文要顶
关注我
收藏该文
与我联系
posted @ 2007-07-05 19:59
吴碧宇
阅读(82)
评论(1)
编辑
收藏
注册用户登录后才能发表评论,请
登录
或
注册
,
返回博客园首页
。
首页
博问
闪存
新闻
园子
招聘
知识库
最新IT新闻
:
·
三星高层称无需担忧苹果智能电视
·
研究发现人们白天使用iPhone多 夜晚用iPad多
·
摩根大通称超极本无法推动PC增长 难撼苹果地位
·
ComScore去年第四季度净亏损330万美元
·
中国移动将投资40亿元在淮安建设全国呼叫中心
»
更多新闻...
最新知识库文章
:
·
进入2012 -- 回顾我走过的编程之路
·
如何学习编程
·
学编程关键在动手,提高在实践
·
十年程序员
·
HTTP 协议详解
»
更多知识库文章...
China-pub 2011秋季教材巡展
China-Pub 计算机绝版图书按需印刷服务
公告
昵称:
吴碧宇
园龄:
4年7个月
粉丝:
7
关注:
2
<
2012年2月
>
日
一
二
三
四
五
六
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
1
2
3
4
5
6
7
8
9
10
搜索
常用链接
我的随笔
我的评论
我的参与
最新评论
我的标签
最新随笔
1. 【转】c# 位操作
2. C#中调用Windows API时的数据类型对应关系
3. 全面理解javascript的caller,callee,call,apply概念[转载]
4. 发几个小的测式软件
5. 關於 IE6/7 不支援 Element 自訂方法屬性繼承的可行解決方案
6. Vs2010 配置驱动开发环境
7. 美杜杉 主动防御最新版
8. Asp.net 异步请求 IHttpAsyncHandler
9. [转]COM线程模型-套间
10. [转]VC使用CRT调试功能来检测内存泄漏
我的标签
javascript
(4)
c++
(2)
com
(2)
js
(2)
asp.net
(2)
MVC
(1)
GridView jsGridView
(1)
对话框
(1)
COM 伪异步调用COM C++ SAFEARRAY IDispatch
(1)
c++ 反射
(1)
更多
随笔分类
(145)
Action Script 3.0(2)
(rss)
asp.net(24)
(rss)
asp.net 控件开发(5)
(rss)
c#(15)
(rss)
C++(45)
(rss)
DotNet(9)
(rss)
Flex(4)
(rss)
JAVA JSF框架(4)
(rss)
JavaScript(25)
(rss)
SQL(5)
(rss)
XML(2)
(rss)
非技术区(4)
(rss)
驱动开发(1)
(rss)
随笔档案
(151)
2011年7月 (2)
2011年1月 (1)
2010年11月 (1)
2010年6月 (1)
2010年5月 (1)
2010年4月 (2)
2010年1月 (1)
2009年12月 (2)
2009年10月 (3)
2009年8月 (1)
2009年7月 (4)
2009年5月 (2)
2009年4月 (3)
2009年3月 (6)
2009年2月 (5)
2009年1月 (3)
2008年12月 (10)
2008年11月 (10)
2008年10月 (8)
2008年9月 (6)
2008年8月 (11)
2008年7月 (14)
2008年6月 (8)
2008年5月 (1)
2008年3月 (2)
2008年2月 (10)
2008年1月 (6)
2007年12月 (3)
2007年11月 (2)
2007年10月 (1)
2007年9月 (1)
2007年8月 (5)
2007年7月 (15)
文章分类
(11)
Provider 模式小型项目数据访问层生成功具(11)
(rss)
文章档案
(13)
2007年10月 (1)
2007年7月 (12)
相册
生活相册
网址
Activex
AS
学习资料01
HttpHandler概要
Jeffrey Zhao (赵劼)
Mobidogs博客
TerryLee's Tech Space
Web设计师应该收藏
xmlhttp对象参考
老赵点滴
李剑博客
林伟博客
我的QQ空间
我的老婆
消万勇博客
赵凯
积分与排名
积分 - 89978
排名 - 1143
最新评论
阅读排行榜
评论排行榜
推荐排行榜