zoukankan
html css js c++ java
Windows Sharepoint Services v3.0,一个简单的审批工作流
根据微软的视频作的例子,一个简单的审批流程
using
System;
using
System.ComponentModel;
using
System.ComponentModel.Design;
using
System.Collections;
using
System.Drawing;
using
System.Workflow.ComponentModel.Compiler;
using
System.Workflow.ComponentModel.Serialization;
using
System.Workflow.ComponentModel;
using
System.Workflow.ComponentModel.Design;
using
System.Workflow.Runtime;
using
System.Workflow.Activities;
using
System.Workflow.Activities.Rules;
using
System.Xml.Serialization;
using
System.Xml;
using
Microsoft.SharePoint;
using
Microsoft.SharePoint.Workflow;
using
Microsoft.SharePoint.WorkflowActions;
using
Microsoft.Office.Workflow.Utility;
namespace
DemoReview
{
public
sealed
partial
class
Workflow1 : SharePointSequentialWorkflowActivity
{
public
Workflow1()
{
InitializeComponent();
}
public
Guid workflowId
=
default
(System.Guid);
public
Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties workflowProperties
=
new
Microsoft.SharePoint.Workflow.SPWorkflowActivationProperties();
public
Guid taskId
=
default
(System.Guid);
public
SPWorkflowTaskProperties taskProps
=
new
Microsoft.SharePoint.Workflow.SPWorkflowTaskProperties();
public
SPWorkflowTaskProperties afterProps
=
new
Microsoft.SharePoint.Workflow.SPWorkflowTaskProperties();
public
SPWorkflowTaskProperties beforeProps
=
new
Microsoft.SharePoint.Workflow.SPWorkflowTaskProperties();
private
string
assignto
=
default
(System.String);
private
string
instructions
=
default
(System.String);
private
int
currentreviewer
=
0
;
private
string
itemtitle
=
default
(System.String);
private
void
onWorkflowActivated1_Invoked(
object
sender, ExternalDataEventArgs e)
{
this
.workflowId
=
workflowProperties.WorkflowId;
itemtitle
=
workflowProperties.Item.DisplayName;
XmlSerializer myserializer
=
new
XmlSerializer(
typeof
(myFields));
XmlTextReader reader
=
new
XmlTextReader(
new
System.IO.StringReader(workflowProperties.InitiationData));
myFields myinitf
=
(myFields)myserializer.Deserialize(reader);
assignto
=
(myinitf.assignees).ToString();
instructions
=
(myinitf.instructions).ToString();
}
private
void
workflownotFinished(
object
sender, ConditionalEventArgs e)
{
if
(
this
.assignto.Split(Convert.ToChar(
"
;
"
)).Length
<
currentreviewer
+
1
)
{
e.Result
=
false
;
}
else
{
e.Result
=
true
;
}
}
private
bool
isFinished
=
false
;
private
void
taskNotFinished(
object
sender,ConditionalEventArgs e)
{
e.Result
=
!
isFinished;
}
private
void
createTask1_MethodInvoking(
object
sender, EventArgs e)
{
taskId
=
Guid.NewGuid();
isFinished
=
false
;
taskProps.Title
=
"
Please Review:
"
+
itemtitle;
taskProps.AssignedTo
=
this
.assignto.Split(Convert.ToChar(
"
;
"
))[
this
.currentreviewer].ToString();
taskProps.Description
=
this
.instructions;
taskProps.ExtendedProperties[
"
instructions
"
]
=
instructions;
}
private
string
comment
=
default
(System.String);
private
void
onTaskChanged1_Invoked(
object
sender, ExternalDataEventArgs e)
{
this
.isFinished
=
bool
.Parse(afterProps.ExtendedProperties[
"
isFinished
"
].ToString());
this
.comment
=
afterProps.ExtendedProperties[
"
comments
"
].ToString();
}
private
void
completeTask1_MethodInvoking(
object
sender, EventArgs e)
{
this
.currentreviewer
++
;
}
}
}
查看全文
相关阅读:
【CSDN博客之星评选】我为什么坚持写博客
关于纯css布局的概况
IIS服务器下301跳转是怎么样实现的?
如何使用数据库保存session的方法简介
PHP如何通过SQL语句将数据写入MySQL数据库呢?
PHP中文函数顺序排列一数组且其序数不变
angular实时显示checkbox被选中的元素
oracle查询正在执行的语句以及正被锁的对象
angular中ng-repeat去重
接口自动化测试框架--http请求的get、post方法的实现
原文地址:https://www.cnblogs.com/puke/p/901565.html
最新文章
在Form Load中设置showInTaskBar =false 或 隐藏窗口 this.Hide()时会导致注册的全局快捷键无效
当批处理中设置有英文括号的变量时,不需要用双引号,否则引用时引用为空
ffmpeg文件生成m3u8文件及ts切片程序(一)
mysql存储过程详解实例
Oracle存储过程语法及编译过程讲解
oracle的存储过程优缺点
Oracle存储过程实例分析总结(代码)
教你轻松解决80端口被占用【图解】
scrapy可视化管理工具spiderkeeper使用笔记
操作系统图解
热门文章
Nginx实战(三) 日志配置与切割
算法之旅,直奔<algorithm>之十 count_if
Eclipse使用技巧总结(三)
linux学习过程中所需要看的一些书籍
线程函数大全
Ibatis调用存储过程实现增删改以及分页查询
读书笔记:网站架构之安全篇
C中的链接属性及作用域
SGU 106 The Equation 扩展欧几里得应用
学习linux能有什么用
Copyright © 2011-2022 走看看