Esempio n. 1
0
        /// <summary>
        /// 设置消息提醒方式
        /// </summary>
        public void SetMsgRemind(GlobalVariable.MsgRemind?remind = null)
        {
            AntSdkUpdateGroupConfigInput input = new AntSdkUpdateGroupConfigInput();

            input.userId  = AntSdkService.AntSdkLoginOutput.userId;
            input.groupId = this.GroupInfo.groupId;
            BaseOutput output  = new BaseOutput();
            var        errCode = 0;
            string     errMsg  = string.Empty;

            if (remind == null)
            {
                input.state = MessageNoticeIsChecked
                    ? ((int)GlobalVariable.MsgRemind.Remind).ToString()
                    : ((int)GlobalVariable.MsgRemind.NoRemind).ToString();
            }
            else
            {
                input.state = ((int)remind.Value).ToString();
            }
            var isResult = AntSdkService.UpdateGroupConfig(input, ref errCode, ref errMsg);

            if (isResult)
            {
                GroupInfo.state = int.Parse(input.state);
                if (GroupInfo.state == (int)GlobalVariable.MsgRemind.NoRemind)
                {
                    MessageNoticeIsChecked  = false;
                    MessageHideIsChecked    = true;
                    ImageNoRemindVisibility = Visibility.Visible;
                }
                else
                {
                    MessageNoticeIsChecked  = true;
                    MessageHideIsChecked    = false;
                    ImageNoRemindVisibility = Visibility.Collapsed;
                }
            }
            else
            {
                MessageBoxWindow.Show(errMsg, GlobalVariable.WarnOrSuccess.Warn);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 设置消息提醒方式
        /// </summary>
        public void SetMsgRemind(GlobalVariable.MsgRemind?remind = null)
        {
            AntSdkUpdateGroupConfigInput input = new AntSdkUpdateGroupConfigInput();

            input.userId  = AntSdkService.AntSdkLoginOutput.userId;
            input.groupId = this.GroupInfo.groupId;
            BaseOutput output  = new BaseOutput();
            var        errCode = 0;
            string     errMsg  = string.Empty;

            if (remind == null)
            {
                input.state = MessageNoticeIsChecked
                    ? ((int)GlobalVariable.MsgRemind.Remind).ToString()
                    : ((int)GlobalVariable.MsgRemind.NoRemind).ToString();
            }
            else
            {
                input.state = ((int)remind.Value).ToString();
            }
            //TODO:AntSdk_Modify
            //DONE:AntSdk_Modify
            var isResult = AntSdkService.UpdateGroupConfig(input, ref errCode, ref errMsg);

            if (isResult)
            {
                GroupInfo.state = int.Parse(input.state);
                if (GroupInfo.state == (int)GlobalVariable.MsgRemind.NoRemind)
                {
                    MessageNoticeIsChecked  = false;
                    MessageHideIsChecked    = true;
                    ImageNoRemindVisibility = Visibility.Visible;
                }
                else
                {
                    MessageNoticeIsChecked  = true;
                    MessageHideIsChecked    = false;
                    ImageNoRemindVisibility = Visibility.Collapsed;
                }

                StructureDetailsVM?.SetMsgRemindState(GroupInfo.state);
                OnMsgRemindEvent();
            }
            else
            {
                MessageBoxWindow.Show(errMsg, GlobalVariable.WarnOrSuccess.Warn);
            }
            //if ((new HttpService()).UpdateGroupConfig(input, ref output, ref errMsg))
            //{
            //    GroupInfo.state = input.state;
            //    //todo
            //    OnMsgRemindEvent();
            //}
            //else
            //{
            //    if (output.errorCode != "1004")
            //    {
            //        MessageBoxWindow.Show(errMsg, GlobalVariable.WarnOrSuccess.Warn);
            //    }
            //}
        }