-
大小: 3.07MB文件类型: .rar金币: 2下载: 0 次发布日期: 2023-09-29
- 语言: 其他
- 标签: c# enterprise mvc4 linq
资源简介
CodeSmith生成MVC4项目工程模板V1.0.12.0920
模板工具:CodeSmith 6.5
CodeSmith生成Visual.Studio.2010.MVC4项目工程模板。
默认用户已经安装了CodeSmith 6.5代码生成工具。
根据输入参数,自动生成Visual Studio 2010 + MVC4 + EnterpriseLibrary5.0项目工程。
注意事项:
1:Visual Studio 2010需要安装SP1。并安装MVC4。具体操作请访问微软官方网站。
1:请在建立数据表时,给数据表的说明字段一个简要说明。在*.cs文件生成时会自动写入合理的注视内容。
项目生成最终结构:
以默认参数为例,生成的项目结构如下:
onehelper.sln
├─onehelper.Controllers
├─onehelper.Core
├─onehelper.Dao
├─onehelper.Dto
├─onehelper.Service
└─onehelper.webClient
模板的当前前端使用yaml css framework 3.3.
操作流程:
1:下载net4.0_MVC4_Entlib_V1.0.1.rar文件。
2:解压缩net4.0_MVC4_Entlib_V1.0.1.rar文件到指定路径下。
3:打开codesmisth 6.5,导入解压缩后的模板文件夹。
4:在CodeSmith Studio中,Template Explorer下,选择Execute.cst,右键菜单Execute。
5:在CodeSmith的执行窗口中设置参数如下:
1.名称空间
RootNamespace ---------> 根名称空间
ClientNamespace -------> 客户端名称空间
ControllerNamespace ---> 控制器名称空间
CoreNamespace ---------> 核心名称空间
DaoNamespace ----------> 数据操作名称空间
DtoNamespace ----------> 传输实体名称空间
ServiceNamespace ------> 服务业务名称空间
2.数据库(数据库中的表字段要有注释!)
Database --------------> 指定一个数据库
ExcludeTables ---------> 指定一个或多个数据表
PrefixLength ----------> 数据表前缀截取长度
TablePrefixes --------->
3.开发者信息(将作为类注释存在)
Author ----------------> 开发者姓名
CompanyName -----------> 公司名称
SystemName ------------> 系统名称
4.杂项(项目工程生成路径)
OutputDirectory -------> 项目工程生成路径
版本说明:
===============================================================
版本号:V1.0.12.0920
===============================================================
修改模板生成语法符合codesmisth 6.5的新语法。
针对.net framework4.0进行了修改。
模板的前端:
暂时添加进了yaml css framework 4.0.1.(*此处不需要可以删除*)
===============================================================
版本号:V1.0.2
===============================================================
请在建立数据表时,给数据表的说明字段一个简要说明。
添加了版本操作详细说明。
存在问题:
生成的web工程不能被打开,需要手动添加到项目工程中。

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Data;
using System.IO;
using System.Text;
using CodeSmith.Engine;
using SchemaExplorer;
namespace Generator
{
public class GeneratorHelper{
///
/// 创建器的实例
///
private static GeneratorHelper instance = null;
///
/// 创建器实例化
///
/// 创建器
public static GeneratorHelper GetInstance()
{
if (instance == null)
{
instance = new GeneratorHelper();
}
return instance;
}
///
/// 创建指定路径下文件夹
///
/// 路径
public void SafeCreateDirectory(string path)
{
if (!System.IO.Directory.Exists(path))
{
System.IO.Directory.CreateDirectory(path);
Debug.WriteLine(string.Format(“create time at-{0} | create folder at-{1}“ DateTime.Now.ToString() path));
}
}
///
/// 复制指定路径下文件到目标文件夹
///
/// 源路径
/// 目标路径
public void SafeCopyDirectory(string source string target)
{
Debug.WriteLine(string.Format(“source path-{0}“ source));
Debug.WriteLine(string.Format(“target path-{0}“ target));
string [] files =System.IO.Directory.GetFiles(source);
for (int i=0; i < files.Length; i++)
{
System.IO.FileInfo file = new System.IO.FileInfo(files[i]);
file.CopyTo(target + “\\“ + file.Name true);
Debug.WriteLine(string.Format(“copy time at-{0} | target path-{1}“ DateTime.Now.ToString() target + “\\“ + file.Name));
}
}
///
/// 复制文件到指定路径
///
/// 源路径
/// 目标路径
public void SafeCopyFile(string source string target)
{
Debug.WriteLine(string.Format(“source path-{0}“ source));
System.IO.FileInfo files = new System.IO.FileInfo(source);
files.CopyTo(target true);
}
///
/// 复制指定路径下文件夹到指定目录中
///
/// 源路径
/// 目标路径
public void SafeCopyFiles(string source string target)
{
// 如果目标目录存在
if (System.IO.Directory.Exists(target))
{
// 目标目录直接删除
System.IO.Directory.Delete(target true);
Debug.WriteLine(string.Format(“delete target path-{0}“ target));
// 删除后,重新创建目标文件夹
System.IO.Directory.CreateDirectory(target);
Debug.WriteLine(string.Format(“Create target path-{0}“ target));
}
else
{
// 目标文件夹不存在,创建文件夹
System.IO.Directory.CreateDirectory(target);
Debug.WriteLine(string.Format(“Create target path-
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 102490 2012-09-21 13:43 net4.0 fr
文件 9161 2012-09-21 12:17 net4.0 fr
文件 14194 2012-05-23 10:15 net4.0 fr
文件 4279 2012-05-21 09:21 net4.0 fr
文件 5913 2012-05-21 09:58 net4.0 fr
文件 2685 2012-05-21 14:41 net4.0 fr
文件 2844 2012-01-29 18:46 net4.0 fr
文件 4083 2011-12-13 10:10 net4.0 fr
文件 2238 2011-12-13 10:10 net4.0 fr
文件 3763 2011-12-13 10:30 net4.0 fr
文件 2578 2011-12-13 10:38 net4.0 fr
文件 2696 2011-12-13 10:38 net4.0 fr
文件 4129 2011-12-13 10:18 net4.0 fr
文件 2467 2011-12-13 10:40 net4.0 fr
文件 2679 2011-12-13 10:43 net4.0 fr
文件 5212 2011-12-13 10:51 net4.0 fr
文件 9334 2012-05-23 08:46 net4.0 fr
文件 6761 2012-05-21 09:51 net4.0 fr
文件 2826 2012-05-21 09:50 net4.0 fr
文件 3119 2012-05-21 09:51 net4.0 fr
文件 2584 2012-05-23 09:41 net4.0 fr
文件 2681 2012-05-23 09:41 net4.0 fr
文件 3567 2012-05-23 09:42 net4.0 fr
文件 5474 2012-05-21 09:51 net4.0 fr
文件 2790 2012-01-23 20:19 net4.0 fr
文件 2568 2011-12-14 10:12 net4.0 fr
文件 7508 2011-12-14 10:09 net4.0 fr
文件 4938 2011-12-14 10:18 net4.0 fr
文件 7717 2012-05-22 09:57 net4.0 fr
文件 7508 2012-05-22 09:56 net4.0 fr
............此处省略421个文件信息
相关资源
- WPF USB 网络 串口 通信软件
- B/S 网上订餐系统
- 教室管理系统.rar
- 小鸡快跑游戏.
-
分别适用于.NET fr
amework 2.0和4.0的E - 汽车租赁系统............................
- 德卡D8读写器关于读写感应卡的一些代
- halcon 测量助手
- 图片存储到数据库保存二进制文件并
- 用Socket写的简易FTP服务器和客户端
- 企业销售管理信息系统(全套)
- 串口操作类(justinio)
- 基于Petri网的工作流(完整的原创源代
- 选择题自动考试系统
- 多线程实例:桌面智能弹球小游戏
- IBM.Rational.Rose.Enterprise的license.upd
- 土地信息管理系统
- Investigation on the present situation of envi
- ServiceStack V3.9 全部dll
- PDF pdfview.ocx 无水印
- Visual Studio 2017企业版 Enterprise,专业版
- Mentor Graphics Expedition Enterprise v7.9.5.r
- 惠普hp LaserJet Enterprise P3015dn黑白激光
- SUSE Linux Enterprise——助力曙光高
- ReportBuilder 官方DEMO+开发指南
- 无需共享打印机实现远程打印功能小
- 真正的破解版PDFView4NET
- 网页调用ActiveX控件获取串口数据
- Luence的与盘古分词的使用软件
- 思科7200IOS C7200-adventerprisek9-mz.152-4.S
评论
共有 条评论