Ejemplo n.º 1
0
        /// <summary>
        /// 查询用户信息
        /// </summary>
        /// <param name="id"></param>
        private void QueryUserInfo(string id)
        {
            if (userInfo != null && id == userInfo.userId)
            {
                return;
            }
            var errMsg = string.Empty;

            //var userOutput = new UserOutput();
            //var input = new UserInput
            //{
            //    token = AntSdkService.AntSdkLoginOutput.token,
            //    version = GlobalVariable.Version,
            //    userId = AntSdkService.AntSdkLoginOutput.userId,
            //    targetUserId = id
            //};
            //TODO:AntSdk_Modify
            //DONE:AntSdk_Modify
            //var user= AntSdkService.AntSdkGetUserInfo(id, ref errMsg);
            // if (user != null)
            // {
            //     userInfo = user;
            // }
            //if (!(new HttpService()).GetUserInfo(input, ref userOutput, ref errMsg))
            //{
            //    userInfo = null;
            //    return;
            //}
            //if (userOutput?.user == null)
            //{
            //    userInfo = null;
            //    return;
            //}
            userInfo = GroupPublicFunction.QueryUserInfo(id);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 查询用户信息
        /// </summary>
        /// <param name="id"></param>
        private async void QueryUserInfo(string id)
        {
            //if(userInfo!=null&&id== userInfo.userId)return;
            //var info = GroupPublicFunction.QueryUserInfo(id);
            //Task.WaitAll();
            //userInfo = info;
            //Application.Current.Dispatcher.Invoke((Action)(SetUserInfo));
            if (userInfo != null && id == userInfo.userId)
            {
                return;
            }
            await Task.Run(() =>
            {
                userInfo = GroupPublicFunction.QueryUserInfo(id);
            });

            SetUserInfo();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 退出讨论组
        /// </summary>
        public void ExitGroup()
        {
            //退出讨论组之前需要先更新讨论组头像
            //UpdateGroupInput updateInput = new UpdateGroupInput();
            //updateInput.groupId = this.GroupInfo.groupId;
            //updateInput.token = AntSdkService.AntSdkLoginOutput.token;
            //updateInput.userId = AntSdkService.AntSdkLoginOutput.userId;
            //updateInput.version = GlobalVariable.Version;
            //updateInput.groupPicture = ImageHandle.GetGroupPicture(Members.Where(c => c.userId != updateInput.userId).Select(c => c.picture).ToList ());
            //BaseOutput updateOutput = new BaseOutput();
            //string errMsg = string.Empty;
            //(new HttpService()).UpdateGroup(updateInput, ref updateOutput, ref errMsg);

            //ExitGroupInput input = new ExitGroupInput();
            //input.groupId = this.GroupInfo.groupId;
            //input.token = AntSdkService.AntSdkLoginOutput.token;
            //input.userId = AntSdkService.AntSdkLoginOutput.userId;
            //input.version = GlobalVariable.Version;
            //BaseOutput output = new BaseOutput();
            //string errMsg = string.Empty;
            //TODO:AntSdk_Modify
            //DONE:AntSdk_Modify
            if (GroupInfo == null)
            {
                return;
            }
            var isResult = GroupPublicFunction.ExitGroup(this.GroupInfo.groupId, this.GroupInfo.groupName, Members);

            if (isResult)
            {
                OnDropOutGroupEvent(this);
            }
            //var isResult = AntSdkService.GroupExitor(AntSdkService.AntSdkLoginOutput.userId, this.GroupInfo.groupId, ref errMsg);
            //if (isResult)
            //{
            //    string[] ThreadParams = new string[2];
            //    ThreadParams[0] = this.GroupInfo.groupId;
            //    ThreadParams[1] = ImageHandle.GetGroupPicture(Members.Where(c => c.userId != AntSdkService.AntSdkLoginOutput.userId).Select(c => c.picture).ToList());
            //    Thread UpdateGroupPictureThread = new Thread(GroupPublicFunction.UpdateGroupPicture);
            //    UpdateGroupPictureThread.Start(ThreadParams);

            //    OnDropOutGroupEvent(this);
            //}
            //else
            //{
            //    MessageBoxWindow.Show(errMsg, GlobalVariable.WarnOrSuccess.Warn);
            //}
            //if ((new HttpService()).ExitGroup(input, ref output, ref errMsg))
            //{
            //    string[] ThreadParams = new string[2];
            //    ThreadParams[0] = this.GroupInfo.groupId;
            //    ThreadParams[1] = ImageHandle.GetGroupPicture(Members.Where(c => c.userId != AntSdkService.AntSdkLoginOutput.userId).Select(c => c.picture).ToList());
            //    Thread UpdateGroupPictureThread = new Thread(UpdateGroupPicture);
            //    UpdateGroupPictureThread.Start(ThreadParams);

            //    OnDropOutGroupEvent(this);
            //}
            //else
            //{
            //    if (output.errorCode != "1004")
            //    {
            //        MessageBoxWindow.Show(errMsg, GlobalVariable.WarnOrSuccess.Warn);
            //    }
            //}
        }