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
++
;
}
}
}
查看全文
相关阅读:
幻方~未完待续
过河(DP)
生日蛋糕(DFS)
n皇后问题<dfs>
POJ 1182_食物链
POJ 2431 Expedition【贪心】
POJ 3268_Silver Cow Party
POJ 1061 青蛙的约会【扩欧】
【数学】扩展欧几里得算法
Codeforces 404D Minesweeper 1D
原文地址:https://www.cnblogs.com/puke/p/901565.html
最新文章
go 并发goroutines,channal
go tcp
go http 客户端
C/C++网络编程中的TCP保活
go build project
「JLOI2014」聪明的燕姿
「SCOI2005」栅栏
「NOIP2014」联合权值
「NOIP2013」华容道
「POJ1147」The Buses
热门文章
「BZOJ4242」水壶
「NOIP2011」Mayan游戏
「NOIP2007」树网的核
「NOIP2010」引水入城
小红的难题<递推>
Rails (堆栈)<数据结构>
阶乘相关<同余与模算术>
丑数<数学技巧>
HDOJ 1319 Prime Cuts<数论>
开心的金明<0-1背包>
Copyright © 2011-2022 走看看