Fax Helper
using System;
using Microsoft.Xrm.Sdk;
using Microsoft.Crm.Sdk.Messages;
using Microsoft.Xrm.Sdk.Query; /// <summary>
/// 传真
/// </summary>
public class FaxHelper
{
public static readonly string entityName = "fax";
public Guid faxId = Guid.Empty;
public IOrganizationService service; /// <summary>
/// 创建传真
/// </summary>
public void Create()
{
WhoAmIRequest userRequest = new WhoAmIRequest();
WhoAmIResponse userResponse = (WhoAmIResponse)service.Execute(userRequest);
Guid _userId = userResponse.UserId; Entity activityEn = new Entity() { LogicalName = "activityparty" };
activityEn["partyId"] = new EntityReference() { LogicalName = "systemuser", Id = _userId }; Entity en = new Entity() { LogicalName = entityName };
en["subject"] = "传值测试";
en["from"] = new Entity[] { activityEn };
en["to"] = new Entity[] { activityEn };
faxId = service.Create(en);
} /// <summary>
/// 将传真分派给其他用户或团队
/// </summary>
/// <param name="assignee">用户或团队引用</param>
public void Assign(EntityReference assignee)
{
AssignRequest request = new AssignRequest();
request.Target = new EntityReference() { LogicalName = entityName, Id = faxId };
request.Assignee = assignee;
AssignResponse response = (AssignResponse)service.Execute(request);
} /// <summary>
/// 发送传真
/// </summary>
public void SendFax()
{
SendFaxRequest request = new SendFaxRequest();
request.FaxId = faxId;
request.IssueSend = true;
SendFaxResponse response = (SendFaxResponse)service.Execute(request);
} /// <summary>
/// 删除指定的安全主体(用户或团队)对传真的所有访问权限
/// </summary>
/// <param name="revokee">用户或团队引用</param>
public void RevokeAccess(EntityReference revokee)
{
RevokeAccessRequest request = new RevokeAccessRequest();
request.Target = new EntityReference() { LogicalName = entityName, Id = faxId };
request.Revokee = revokee;
RevokeAccessResponse response = (RevokeAccessResponse)service.Execute(request);
} /// <summary> ///
/// 删除传真 ///
/// </summary>
public void Delete() { service.Delete(entityName, faxId); }
}
Fax Helper的更多相关文章
- [C#] 简单的 Helper 封装 -- RegularExpressionHelper
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- handlebars自定义helper的写法
handlebars相对来讲算一个轻量级.高性能的模板引擎,因其简单.直观.不污染HTML的特性,我个人特别喜欢.另一方面,handlebars作为一个logicless的模板,不支持特别复杂的表达式 ...
- Encountered an unexpected error when attempting to resolve tag helper directive '@addTagHelper' with value '"*, Microsoft.AspNet.Mvc.TagHelpers"'
project.json 配置: { "version": "1.0.0-*", "compilationOptions": { " ...
- VS2015突然报错————Encountered an unexpected error when attempting to resolve tag helper directive '@addTagHelper' with value 'Microsoft.AspNet.Mvc.Razor.TagHelpers.UrlResolutionTagHelper
Encountered an unexpected error when attempting to resolve tag helper directive '@addTagHelper' with ...
- JavaScript模板引擎artTemplate.js——template.helper()方法
上一篇文章我们已经讲到了helper()方法,但是上面的例子只是一个参数的写法,如果是多个参数,写法就另有区别了. <div id="user_info"></d ...
- [ASP.NET MVC 小牛之路]13 - Helper Method
我们平时编程写一些辅助类的时候习惯用“XxxHelper”来命名.同样,在 MVC 中用于生成 Html 元素的辅助类是 System.Web.Mvc 命名空间下的 HtmlHelper,习惯上我们把 ...
- asp.net MVC helper 和自定义函数@functions小结
asp.net Razor 视图具有.cshtml后缀,可以轻松的实现c#代码和html标签的切换,大大提升了我们的开发效率.但是Razor语法还是有一些棉花糖值得我们了解一下,可以更加强劲的提升我们 ...
- C# random helper class
项目中经常需要模拟些假数据,来做测试.这个随机生成数据的helper类就应用而生: using System; using System.Text; using System.Windows.Me ...
- @helper函数使用方法
这个函数方法,我也是通过别人博客看到的,感觉不错和大家一起学习分享一下. 1.自定义函数方法,只在同一个view视图文件里调用 Controller public ActionResult Index ...
随机推荐
- MyCAT详解
一.MyCAT概述 MyCAT是一款由阿里Cobar演变而来的用于支持数据库读写分离.分片的分布式中间件.MyCAT可不但支持Oracle.MSSQL.MYSQL.PG.DB2关系型数据库,同时也支持 ...
- windows线程时间打印
https://blog.csdn.net/xingcen/article/details/70084029
- centos msyql 5.7 yum安装
1.wget https://repo.mysql.com//mysql57-community-release-el6-11.noarch.rpm 2.yum localinstall mysql5 ...
- Struts学习-Hibernate
Hibernate (开放源代码的对象关系映射框架) http://www.cnblogs.com/wenwen123/p/5658625.html 一. 1.新建 2.配置 <!-- hibe ...
- python 枚举类
枚举类 Enum类 from enum import Enum Month = Enum('Month', ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Ju ...
- centos 6 YUM安装 lnmp
准备篇: 1.配置防火墙,开启80端口.3306端口 vi /etc/sysconfig/iptables -A INPUT -m state --state NEW -m t ...
- ZT自贴吧 说说你是怎么和恋人确定恋爱关系的?
http://www.baidu.com/link?url=svJFMqibXXhJUiGDaDr1obOyrIb9o0TqO5JWFtMuM-l7ndaRlGMyuRQKCOHh-Pj0
- jmeter测试mysql性能
1.下载jdbc.将jdbc解压,将mysql-connector-java-version-ga-bin.jar这个文件copy到jmeter/lib下 2.打开jmeter,设置jdbc请求. 1 ...
- SOJ4459 skysky's game(贪心+优先队列)
天天最近迷上了天天爱消除游戏,现在他觉得这个游戏已经没有意思了.所以他发明一个新的消除游戏.有n堆糖果,每一个糖果有一个重量w,天天每次都选择两个糖果合并为一个糖果,新的糖果的重量等于这两个糖果的重量 ...
- openCV2马拉松第19圈——Harris角点检測(自己实现)
计算机视觉讨论群162501053 转载请注明:http://blog.csdn.net/abcd1992719g/article/details/26824529 收入囊中 使用OpenCV的con ...