.net之工作流工程展示及代码分享(一)工作流表单
2015-02-28 16:56
375 查看
Workflow表单的作用是能够在客户端进行表单设计,然后在流程中动态开放哪些输入框可以供用户填写。
在这里我扩展了一个常用的WebEditor工具——KindEditor,能够插入自定义的html符号,如下图:
View Code
Form类使用InitializeFormControls方法生成各种实例化控件,放在FormControls字段里。
这两个类使用的基本上是领域模型。
本系列导航:
.net之工作流工程展示及代码分享(预告)
.net之工作流工程展示及代码分享(一)工作流表单
.net之工作流工程展示及代码分享(二)工作流引擎
.net之工作流工程展示及代码分享(三)数据存储引擎
.net之工作流工程展示及代码分享(四)主控制类
.net之工作流工程展示及代码分享(五)前端交互
在这里我扩展了一个常用的WebEditor工具——KindEditor,能够插入自定义的html符号,如下图:
[Serializable] public class TextLineFormControl : FormControl { public override string GetDesignString() { return string.Format("<input type=\"text\" value=\"{0}//{1}//{2}\" style=\"{3}\" id=\"{4}\">", WorkflowConstant.TextBoxFormControlName, FieldName, Width, WorkflowConstant.ControlDesignWidth,ControlId); } public override string GetInputString() { return string.Format("<input type=\"text\" value=\"{0}\" id=\"{1}\" size=\"{2}\" maxlength=\"{2}\" name=\"{1}\" >", FieldValue, ControlId, Width); } } [Serializable] public class MultiLineFormControl : FormControl { public override string GetDesignString() { return string.Format("<input type=\"text\" value=\"{0}//{1}//{2}//{5}\" style=\"{3}\" id=\"{4}\">", WorkflowConstant.TextAreaFormControlName, FieldName, Width, WorkflowConstant.ControlDesignWidth, ControlId, Height); } public override string GetInputString() { return string.Format("<textarea cols=\"{2}\" rows=\"{3}\" id=\"{1}\" name=\"{1}\" >{0}</textarea>", FieldValue != null ? FieldValue.Replace("<br/>", "\n\r") : string.Empty, ControlId, Width, Height); } } [Serializable] public class RadioFormControl : FormControl { public override string GetDesignString() { return string.Format("<input type=\"text\" value=\"{0}//{1}//{2}\" style=\"{3}\" id=\"{4}\">", WorkflowConstant.RadioFormControlName, FieldName, InitialData, WorkflowConstant.ControlDesignWidth, ControlId); } public override string GetInputString() { StringBuilder sb= new StringBuilder(); var data = InitialData.Split('|'); for (int i = 0; i < data.Length; i ++) { sb.AppendFormat("<input type=\"radio\" name=\"{0}\" id=\"{0}-{1}\" value=\"{2}\" {3}/>", ControlId, i, data[i], FieldValue == data[i] ? " checked=\"checked\"" : string.Empty); sb.AppendFormat("<label for=\"{0}-{1}\">{2}</label>", ControlId, i, data[i]); } return sb.ToString(); } } .........
View Code
Form类使用InitializeFormControls方法生成各种实例化控件,放在FormControls字段里。
这两个类使用的基本上是领域模型。
本系列导航:
.net之工作流工程展示及代码分享(预告)
.net之工作流工程展示及代码分享(一)工作流表单
.net之工作流工程展示及代码分享(二)工作流引擎
.net之工作流工程展示及代码分享(三)数据存储引擎
.net之工作流工程展示及代码分享(四)主控制类
.net之工作流工程展示及代码分享(五)前端交互
相关文章推荐
- .net之工作流工程展示及代码分享(预告)
- .net之工作流工程展示及代码分享(二)工作流引擎
- .net之工作流工程展示及代码分享(四)主控制类
- .net之工作流工程展示及代码分享(三)数据存储引擎
- net之工作流工程展示及代码分享(记录)
- 大恶人吉日嘎拉之走火入魔闭门造车之.NET疯狂架构经验分享系列之(一)后台控制逻辑代码部分
- .Net代码分享群,欢迎大家加入~
- 大恶人吉日嘎拉之走火入魔闭门造车之.NET疯狂架构经验分享系列之(三)商业逻辑代码部分
- 大恶人吉日嘎拉之走火入魔闭门造车之.NET疯狂架构经验分享系列之(五)代码复用
- 【分享】发两个关于.net反混淆未完的代码,半年多没动了,以后也可能不再玩儿.net了,共享出来供交流
- 大恶人吉日嘎拉之走火入魔闭门造车之.NET疯狂架构经验分享系列之(五)代码复用
- 大恶人吉日嘎拉之走火入魔闭门造车之.NET疯狂架构经验分享系列之(一)后台控制逻辑代码部分
- 大恶人吉日嘎拉之走火入魔闭门造车之.NET疯狂架构经验分享系列之(二)后台服务代码部分
- 大恶人吉日嘎拉之走火入魔闭门造车之.NET疯狂架构经验分享系列之(三)商业逻辑代码部分
- 分享.NET开发中经常使用到的代码片段 完全从实际项目中提取出来,也可被反反复复的重复借用
- 大恶人吉日嘎拉之走火入魔闭门造车之.NET疯狂架构经验分享系列之(三)商业逻辑代码部分
- VS2010使用.net 4.0中的ASP.NET MVC 2 模板建立工程后无法提交HTML代码解决方案一则
- .net常用控件绑定代码分享
- 一步一步学习sharepoint2010 workflow 系列第二部分:SharePoint无代码工作流 第7章 自定义表单的基础知识(Custom form fundamentals)
- 工作流系统之二十七 .net工作流系统集成自定义表单