登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

忆风的博客

http://www.cnblogs.com/dhjdhja

 
 
 

日志

 
 
 
 

CRM工作流输入输出参数  

2009-06-10 10:33:23|  分类: CRM学习 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

例:

using System;
using System.Collections;
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.Reflection;

using Microsoft.Crm.Workflow;
using Microsoft.Crm.Sdk;
using Microsoft.Crm.SdkTypeProxy;
using Microsoft.Crm.Sdk.Query;

using System.Data.SqlClient;

namespace zz_zywqjActivityLibrary
{
    [CrmWorkflowActivity("获取当前业务期间", "自定义工作流程")]
    public partial class huoqueywqj : Activity
 {
        protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
        {
            try
            {
                SqlConnection conn = new SqlConnection(clsCn.GetCnCrm());
                conn.Open();
                SqlCommand cmd = new SqlCommand("select zz_zywqjid,zz_name from zz_zywqj where Zz_ywlx="+clsCn.GetPackListValue("zz_zywqj","zz_ywlx",业务类型)+" and Zz_sfdqqj=1",conn);
                SqlDataReader dr = cmd.ExecuteReader();
                if (dr.Read())
                {
                    string csid = dr["zz_zywqjid"].ToString();
                    ywqj = new Lookup("zz_zywqj", new Guid(csid));
                    string tyw=dr["zz_name"].ToString();
                    业务期间 = tyw;
                }
                conn.Close();
            }
            catch
            {
            }
            return base.Execute(executionContext);
        }

        public static DependencyProperty 业务类型Property =
           DependencyProperty.Register("业务类型",
           typeof(String),
           typeof(huoqueywqj));

        [CrmInput("业务类型")]
        public String 业务类型
        {
            get
            {
                return (String)base.GetValue(业务类型Property);
            }
            set
            {
                base.SetValue(业务类型Property, value);
            }

        }

        public static DependencyProperty ywqjProperty =
            DependencyProperty.Register("ywqj",
            typeof(Lookup),
            typeof(huoqueywqj));

        [CrmOutput("ywqj")]
        [CrmReferenceTarget("zz_zywqj")]
        public Lookup ywqj
        {
            get
            {
                return (Lookup)base.GetValue(ywqjProperty);
            }
            set
            {
                base.SetValue(ywqjProperty, value);
            }
        }

        public static DependencyProperty 业务期间Property =
            DependencyProperty.Register("业务期间",
            typeof(String),
            typeof(huoqueywqj));

        [CrmOutput("业务期间")]
        public String 业务期间
        {
            get
            {
                return (String)base.GetValue(业务期间Property);
            }
            set
            {
                base.SetValue(业务期间Property, value);
            }
        }
 }
}

  评论这张
 
阅读(216)| 评论(0)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018