码迷,mamicode.com
首页 > 其他好文 > 详细

Create Custom Modification Form In VS 2012-Part2

时间:2014-08-20 16:18:32      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:blog   http   os   io   for   ar   2014   art   

bubuko.com,布布扣

1.SPWorkflowModification ContextData is XMLSerialized as String.

2.Get SPWorkflowModification ContextData in modification page

  protected void GetContexData()
        {
            SPWeb currentWeb = SPContext.Current.Web;
            string strWorkflowInstanceId = Convert.ToString(Request["WorkflowInstanceID"]);
            string strModificationId =Convert.ToString(Request["ModificationID"]);
            string strListId = Convert.ToString(Request["List"]);
            SPWorkflow currentWorkflow = new SPWorkflow(currentWeb, new Guid(strWorkflowInstanceId));
            if (currentWorkflow!=null)
            {
                SPWorkflowModification currentModification = currentWorkflow.Modifications[new Guid(strModificationId)];
                txt_context.Text = currentModification.ContextData;
            }
        }

3.Update SPWorkflowModification ContextData in modification page

    SPWeb currentWeb = SPContext.Current.Web;
            string strWorkflowInstanceId = Convert.ToString(Request["WorkflowInstanceID"]);
            string strModificationId = Convert.ToString(Request["ModificationID"]);
            string strListId = Convert.ToString(Request["List"]);
            SPWorkflow currentWorkflow = new SPWorkflow(currentWeb, new Guid(strWorkflowInstanceId));
            if (currentWorkflow != null)
            {
                currentWeb.AllowUnsafeUpdates = true;
                SPWorkflowModification currentModification = currentWorkflow.Modifications[new Guid(strModificationId)];
                currentWeb.Site.WorkflowManager.ModifyWorkflow(currentWorkflow, currentModification, "111;222;333;444;555;666;777;");
                SPUtility.Redirect("WrkStat.aspx", SPRedirectFlags.UseSource, Context);
                currentWeb.AllowUnsafeUpdates = false;
            }
            else
            {
                //SPUtility.Redirect("WrkStat.aspx", SPRedirectFlags.UseSource, Context);
            }

 

4.Get SPWorkflowModification ContextData in Workflow

  workflowProperties.Workflow.Modifications[SPWorkflowModificationId]

Create Custom Modification Form In VS 2012-Part2,布布扣,bubuko.com

Create Custom Modification Form In VS 2012-Part2

标签:blog   http   os   io   for   ar   2014   art   

原文地址:http://www.cnblogs.com/PeterHome/p/3924639.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!