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
++
;
}
}
}
查看全文
相关阅读:
前进篇
2014年12月14日记
转载了两篇别人写的话语
想好了,也决定了
活着
c#字典排序
插值转向
unity手游使用terrian注意事项
委托delegate 泛型委托action<> 返回值泛型委托Func<> 匿名方法 lambda表达式 的理解
推荐博客关于uniy
原文地址:https://www.cnblogs.com/puke/p/901565.html
最新文章
【解决方案】EasyCVR安防视频云服务城市污水处理厂解决方案
【解决方案】如何基于视频协议融合平台EasyCVR搭建一套多厂家前端设备支持的视频监控系统?
TSINGSEE青犀视频开发ffmpegAPI实现RTP推流客户端无法解析播放如何解决?
TSINGSEE青犀视频如何通过webrtc-client实现超低延时的安防直播?
基于EasyCVR视频平台开发的视频直播管理平台EasyCVS如何调整已绑定流状态的勾选?
RTSP/GB28181/SDK视频协议融合平台EasyCVR的端口号配置跟视频流的播放有什么关系?
今天while if wlse..
FAY6,while语句,if语句
今天while if wlse..
strip,stratswith,endswith等一些的使用方法。
热门文章
DAY5基本类型
7月15日
第一次编程
操作系统的发展,以及多道技术
IDE,pycharm
Hihocoder 之 #1097 : 最小生成树一·Prim算法 (用vector二维 模拟邻接表,进行prim()生成树算法, *【模板】)
hihocoder hiho一下 第二十六周 最小生成树一·(Prim算法)
二叉树的基础应用(建树+叶子数+深度+遍历 )
hihocoder 1015 KMP(找多个位置的 【*模板】)
hihocoder 1082 然而沼跃鱼早就看穿了一切 (替换指定的串 )
Copyright © 2011-2022 走看看