コード例 #1
0
        //[TestMethod]
        public void BatchDeleteMemberTest(string[] userIds)
        {
            var accessToken = AccessTokenContainer.GetToken(_corpId, base._corpSecret);
            var result      = MailListApi.BatchDeleteMember(accessToken, userIds);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.errcode == ReturnCode_Work.请求成功);
        }
コード例 #2
0
        public WorkJsonResult BatchDeleteMember(BatchDeleteMember dto)
        {
            dto.IDList = (GetDepartmentMember(new GetDepartmentMemberDto {
                FetchChild = 1, DepartmentId = 1
            }) as GetDepartmentMemberResult).userlist.Select(p => p.userid).ToArray();
            dto.IDList = dto.IDList.Where(p => p != "da6dc622-0cd8-4d8b-be3f-8d6fc536dd6e").ToArray();
            //dto.AccessToken = GetAccessToken(QyConfig.CorpID, QyConfig.CorpSecret);
            var result = MailListApi.BatchDeleteMember(dto.AccessToken, dto.IDList);

            return(result);
        }
コード例 #3
0
        public static bool BatchDeleteMember(string[] userIds, ref string erromsg)
        {
            try
            {
                var result = MailListApi.BatchDeleteMember(GetToken(), userIds);
            }
            catch (ErrorJsonResultException ex)
            {
                erromsg = WxReturnCodeMessage.GetReturnMessage((int)ex.JsonResult.errcode);
                return(false);
            }

            return(true);
        }
コード例 #4
0
ファイル: myCommFun.cs プロジェクト: SYZhai/WeiBMS
        /// <summary>
        /// 批量删除成员
        /// </summary>
        /// <param name="_userId"></param>
        /// <returns></returns>
        public static bool BatchDeleteMember(string[] _userIdList)
        {
            AccessTokenResult access_token_result = new AccessTokenResult();
            QYConfigInfo      config = GetQYConfig();

            access_token_result = CommonApi.GetToken(config.QYCorpId, config.QYSecret);
            //调用接口
            var result = MailListApi.BatchDeleteMember(access_token_result.access_token, _userIdList);

            if (result.errmsg == "deleted")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }