一:QuickFlow的安装

1,从http://quickflow.codeplex.com/下载解决方案包以及设计器。

2,将QuickFlow.dll以及QuickFlow.UI.dll添加到程序集引用。

3,将QuickFlow2010.wsp部署到站点上并激活。

4,创建一个任务列表,用来存储工作流运行后的历史。

二:QuickFlow的使用

1,发布工作流;

选择File—Publish to SharePoint—

2,创建变量;

3,给变量赋值;

在开始节点的AfterRule里面给该变量赋值

4,搜集了一些工作流中常用到的代码。

//获取列表项的Id
string itemId =this.GetVariable("ListitemID").ToString();
//获取列表
SPList cfgList = this.Web.Lists["项目备案信息"];
//获取一条数据
var cfgItem = cfgList.GetItemById(Convert.ToInt32(itemId));
//给申请人变量赋值
SPFieldUserValue ProjectUser= cfgItem.Fields.GetField("ProjectUser").GetFieldValue(cfgItem["ProjectUser"].ToString()) as SPFieldUserValue;
//this.SetVariable("人员", ProjectUser.User.LoginName);
//给项目区域赋值
SPFieldLookupValue proprovince=cfgItem.Fields.GetField("ProjectProvince").GetFieldValue(cfgItem["ProjectProvince"].ToString()) as SPFieldLookupValue ;
this.SetVariable("项目区域",proprovince.LookupValue);
//给项目大区赋值
SPFieldLookupValue probigZone=cfgItem.Fields.GetField("BigZone").GetFieldValue(cfgItem["BigZone"].ToString()) as SPFieldLookupValue ;
this.SetVariable("项目大区",probigZone.LookupValue);
//给项目战区赋值
SPFieldLookupValue proWarZone=cfgItem.Fields.GetField("WarZone").GetFieldValue(cfgItem["WarZone"].ToString()) as SPFieldLookupValue ;
this.SetVariable("项目战区",proWarZone.LookupValue); //到员工信息表中查询总经理
QueryField qfloginname=new QueryField("LoginName");
QueryField headManager=new QueryField("Role"); SPList cfgListEmploy = this.Web.Lists["员工信息"];
//获取一条数据
SPListItemCollection cfgItemhead=ListQuery.From(cfgListEmploy).Where(headManager=="总经理").GetItems(); if(cfgItemhead.Count>)
{
this.SetVariable("总经理",cfgItemhead[]["LoginName"]);
} //获取一条数据
var cfgItemEmploy = ListQuery.From(cfgListEmploy).Where(qfloginname==ProjectUser.User.LoginName).GetItems()[];
if(cfgItemEmploy!=null)
{ this.SetVariable("人员",cfgItemEmploy["Title"]); //给人员区域赋值
SPFieldLookupValue provinceEmploy=cfgItemEmploy.Fields.GetField("Province").GetFieldValue(cfgItemEmploy["Province"].ToString()) as SPFieldLookupValue;
this.SetVariable("人员区域",provinceEmploy.LookupValue); //给人员大区赋值
SPFieldLookupValue BigZoneEmploy=cfgItemEmploy.Fields.GetField("BigZone").GetFieldValue(cfgItemEmploy["BigZone"].ToString()) as SPFieldLookupValue;
this.SetVariable("人员大区",BigZoneEmploy.LookupValue); //给人员战区赋值
SPFieldLookupValue WarZoneEmploy=cfgItemEmploy.Fields.GetField("WarZone").GetFieldValue(cfgItemEmploy["WarZone"].ToString()) as SPFieldLookupValue;
this.SetVariable("人员战区",WarZoneEmploy.LookupValue);
//给申请人上级经理赋值
SPFieldUserValue TopManager= cfgItemEmploy.Fields.GetField("Manager").GetFieldValue(cfgItemEmploy["Manager"].ToString()) as SPFieldUserValue;
this.SetVariable("申请人上级经理", TopManager.User.LoginName); //到大区表中查询数据
SPList cfgListBigZone = this.Web.Lists["大区"];
//获取一条数据 var cfgItemUserBigZone = cfgListBigZone.GetItemById(BigZoneEmploy.LookupId);
var cfgItemProBigZone = cfgListBigZone.GetItemById(probigZone.LookupId);
//给申请人大区经理赋值
if(cfgItemUserBigZone!=null)
{
SPFieldUserValue UserBigZoneManager= cfgItemUserBigZone.Fields.GetField("Manager").GetFieldValue(cfgItemUserBigZone["Manager"].ToString()) as SPFieldUserValue;
this.SetVariable("申请人大区经理",UserBigZoneManager.User.LoginName); }
//给项目大区经理赋值
if(cfgItemProBigZone!=null)
{
SPFieldUserValue ProBigZoneManager= cfgItemProBigZone.Fields.GetField("Manager").GetFieldValue(cfgItemProBigZone["Manager"].ToString()) as SPFieldUserValue;
this.SetVariable("项目大区经理", ProBigZoneManager.User.LoginName); }
//到战区表中查询数据
SPList cfgListwarZone = this.Web.Lists["战区"]; //获取一条数据
var cfgItemUserWarZone=cfgListwarZone.GetItemById(WarZoneEmploy.LookupId);
var cfgItemProWarZone=cfgListwarZone.GetItemById(proWarZone.LookupId); if(cfgItemUserWarZone!=null)
{
//给申请人战区经理赋值
SPFieldUserValue UserWarZoneManager= cfgItemUserWarZone.Fields.GetField("Manager").GetFieldValue(cfgItemUserWarZone["Manager"].ToString()) as SPFieldUserValue;
this.SetVariable("申请人战区经理", UserWarZoneManager.User.LoginName);
}
if(cfgItemProWarZone!=null)
{
//给项目战区经理赋值
SPFieldUserValue ProWarZoneManager= cfgItemProWarZone.Fields.GetField("Manager").GetFieldValue(cfgItemProWarZone["Manager"].ToString()) as SPFieldUserValue;
this.SetVariable("项目战区经理", ProWarZoneManager.User.LoginName);
} }

SharePoint2010QuickFlow安装及使用的更多相关文章

  1. docker——容器安装tomcat

    写在前面: 继续docker的学习,学习了docker的基本常用命令之后,我在docker上安装jdk,tomcat两个基本的java web工具,这里对操作流程记录一下. 软件准备: 1.jdk-7 ...

  2. 网络原因导致 npm 软件包 node-sass / gulp-sass 安装失败的处理办法

    如果你正在构建一个基于 gulp 的前端自动化开发环境,那么极有可能会用到 gulp-sass ,由于网络原因你可能会安装失败,因为安装过程中部分细节会到亚马逊云服务器上获取文件.本文主要讨论在不变更 ...

  3. Sublime Text3安装JsHint

    介绍 Sublime Text3使用jshint依赖Nodejs,SublimeLinter和Sublimelinter-jshint. NodeJs的安装省略. 安装SublimeLinter Su ...

  4. Fabio 安装和简单使用

    Fabio(Go 语言):https://github.com/eBay/fabio Fabio 是一个快速.现代.zero-conf 负载均衡 HTTP(S) 路由器,用于部署 Consul 管理的 ...

  5. gentoo 安装

    加载完光驱后 1进行ping命令查看网络是否通畅 2设置硬盘的标识为GPT(主要用于64位且启动模式为UEFI,还有一个是MBR,主要用于32位且启动模式为bois) parted -a optima ...

  6. Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级

    Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 5.安装Database软件 5. ...

  7. Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part1:准备工作

    Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part1:准备工作 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 1.实施前准备工作 1.1 服务器安装操 ...

  8. 【原】nodejs全局安装和本地安装的区别

    来微信支付有2年多了,从2年前的互联网模式转变为O2O模式,主要的场景是跟线下的商户去打交道,不像以往的互联网模式,有产品经理提需求,我们帮忙去解决问题. 转型后是这样的,团队成员更多需要去寻找业务的 ...

  9. tLinux 2.2下安装Mono 4.8

    Tlinux2.2发行版基于CentOS 7.2.1511研发而成,内核版本与Tlinux2.0发行版保持完全一致,更加稳定,并保持对Tlinux2.0的完全兼容.Mono 4版本要求CentOS 7 ...

随机推荐

  1. Canvas学习:globalCompositeOperation详解

    在默认情况之下,如果在Canvas之中将某个物体(源)绘制在另一个物体(目标)之上,那么浏览器就会简单地把源特体的图像叠放在目标物体图像上面. 简单点讲,在Canvas中,把图像源和目标图像,通过Ca ...

  2. HTML表单相关

    表单:<input type="text" name="" value="" size="显示字符数" maxle ...

  3. JQuery和html+css实现带小圆点和左右按钮的轮播图

    是的!你没看错!还是轮播图.这次的JQuery的哟!! CSS代码: /*轮播图 左右按钮 小白点*/ #second_div{ margin-top: 160px; } .img_box{ over ...

  4. 六、angular 生成二维码

    首先需要安装angular-qrcode : bower install monospaced/angular-qrcode npm install angular-qrcode 如何使用? 在相应的 ...

  5. VS2010 创建 windows service 程序

    参考网上保护眼睛程序,自写程序如下. 1.创建一个名词为“CareEyeService”,类型为“WindowsService”的应用程序. 自动生成代码如下图: 2.修改ServiceCareEye ...

  6. 三、python小功能记录——杀掉进程

    import os os.system("taskkill /F /IM python.exe")#旧版 os.system("taskkill /F /IM py.ex ...

  7. 文件复制(shutil)

    import shutil #拷贝整个目录树 shutil.copytree('d:\\aaa','e:\\aaa') #目标文件夹(e:\aaa)必须不存在 shutil.rmtree('e:\\a ...

  8. Python学习---Django误删除sql表后,如何创建数据

    误删除sql表后,怎么创建数据? 仅仅适合单表,多表因为涉及约束, python mangage.py makemigrations  --> 生成migrations目录和根数据库对应的sql ...

  9. TMG 2010 使用脚本来导入URL集和域名集

    作为一个网管,相信有领导叫你限制员工上网的情况,例如只限制员工访问某些网站.在禁止的网站数量少的时候,添加URL集或者域名集是一件很简单的事情,如果禁止的网站数量多达1500个呢?如果再使用ISA S ...

  10. c# 内存泄漏检查心得

    系统环境 windows 7 x64 检查工具:ANTS Memory Profiler 7 或者 .NET Memory Profiler 4.0 开发的软件为winform / windows s ...