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
++
;
}
}
}
查看全文
相关阅读:
js与jquery常用数组方法总结
js 对象深复制,创建对象和继承
Web前端面试常识
jQuery插件开发之boxScroll与marquee
jQuery插件开发之windowScroll
《将博客搬至CSDN》
蓝桥杯 翻硬币
AcWing 756.蛇形矩阵
货仓选址
费解的开关
原文地址:https://www.cnblogs.com/puke/p/901565.html
最新文章
网页制作标准
前端页面标准
移动端常见问题
如何在博客园的个人首页添加背景音乐
如何修改博客园里个人首页背景
AtCoder Dwango Programming Contest V E
Reborn & Recover
AFO
NOI 2017滚粗退役记
2017FJ省队集训 游记
热门文章
【UOJ#228】 基础数据结构练习题
【BZOJ4671】 异或图
「美团 CodeM 初赛 Round A」试题泛做
「美团 CodeM 资格赛」试题泛做
【BZOJ4176】 Lucas的数论
Node child_process 备忘
Mac 电脑前端环境配置
js Date对象总结
js 页面间的通信
js if和switch,==和===
Copyright © 2011-2022 走看看