Dynamic 分派操作、共享记录

#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> /// 共享记录

上一篇:leetcode刷题_PYTHON(15):链表(15) 重排链表


下一篇:【转】一种Vue应用程序错误/异常处理机制