首页 > 其他 > 详细

Dynamic 分派操作、共享记录

时间:2021-09-13 20:28:55      阅读:28      评论:0      收藏:0      [点我收藏+]

#region 停用记录状态 /// <summary> /// 信用记录状态 /// </summary> /// <param name="service"></param> /// <param name="entity">实体</param> /// <param name="state">状态</param> /// <param name="status">状态描述</param> public void SetEntityState(IOrganizationService service, EntityReference entityMoniker, int state, int status) { SetStateRequest setRequest = new SetStateRequest() { EntityMoniker = entityMoniker, State = new OptionSetValue(state), Status = new OptionSetValue(status), }; SetStateResponse setResponse = (SetStateResponse)service.Execute(setRequest); } #endregion #region 共享记录 /// <summary> /// 共享记录 /// </summary> /// <param name="service"></param> /// <param name="teamOrSystem">要共享给用户或者团队</param> /// <param name="target">要共享的记录</param> public void Grant(IOrganizationService service, EntityReference teamOrSystem, EntityReference target) { GrantAccessRequest grantAccessRequest = new GrantAccessRequest { PrincipalAccess = new PrincipalAccess { Principal = teamOrSystem, AccessMask = AccessRights.ReadAccess | AccessRights.WriteAccess }, Target = target, }; service.Execute(grantAccessRequest); } #endregion #endregion #region 取消共享记录 /// <summary> /// 共享记录 /// </summary> /// <param name="service"></param> /// <param name="ls">要取消共享给用户或者团队</param> /// <param name="target">要取消共享的记录</param> public void ClearGrant(IOrganizationService service, List<EntityReference> ls, EntityReference target) { foreach (EntityReference item in ls) { RevokeAccessRequest revokeAccessRequest = new RevokeAccessRequest { Revokee = item, Target = target, }; service.Execute(revokeAccessRequest); } } #endregion #region 分派记录 /// <summary> /// 分派记录 /// </summary> /// <param name="service"></param> /// <param name="teamOrSystem">分派给用户或者团队</param> /// <param name="target">要分派的记录</param> public void Assing(IOrganizationService service, EntityReference teamOrSystem, EntityReference target) { AssignRequest assign = new AssignRequest() { Assignee = teamOrSystem, Target = target, }; service.Execute(assign); } #endregion

Dynamic 分派操作、共享记录

原文:https://www.cnblogs.com/LanHai12/p/15257990.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!