Пример #1
0
        //9.2.8	删除群组成员
        public string DeleteGroupMember(QChat_GroupMember qchat)
        {
            QchatQEDService qqs = new QchatQEDService();

            qqs = getQchatQEDService(qchat.username, qchat.password, qchat.deviceID, qchat.urlIp);

            //删除群组成员
            GroupMemberRequest gmr = new GroupMemberRequest();

            gmr.memberSize = qchat.memberSize; // 2;
            gmr.groupCode  = qchat.groupCode;  // "zppaam678685";
            GroupMemberInfo[] groupMemberCollection = new GroupMemberInfo[1];
            GroupMemberInfo   groupmember1          = new GroupMemberInfo();

            groupmember1.number = qchat.number_mem; // "15314604085";
            groupmember1.type   = qchat.type_mem;   // 1;
            groupmember1.name   = qchat.name_mem;   // "testname";
            groupmember1.level  = qchat.lebel;      // 4;

            groupMemberCollection[0] = groupmember1;
            gmr.gMemInfo             = groupMemberCollection;
            QedRequest qedr = new QedRequest();

            qedr.groupMemRequest = gmr;

            StringBuilder sb       = new StringBuilder();
            QedResponse   response = qqs.deleteGroupMember(qedr);

            GroupMemberResponse gresponse = response.groupMemResponse;

            if (gresponse != null && gresponse.response != null)
            {
                sb.AppendLine("Count: " + gresponse.count);
                for (int i = 0; i < gresponse.count; i++)
                {
                    sb.AppendLine("description:" + gresponse.response[i].description);
                    sb.AppendLine("reserve:" + gresponse.response[i].reserve);
                    sb.AppendLine("returnCode: " + gresponse.response[i].returnCode);
                }
            }
            else
            {
                sb.AppendLine("返回信息为null");
            }
            Console.WriteLine(sb);

            //Console.ReadKey();
            return(sb.ToString());
        }
Пример #2
0
            //9.2.8	删除群组成员
        public string DeleteGroupMember(QChat_GroupMember qchat)
        {
            QchatQEDService qqs = new QchatQEDService();
            qqs = getQchatQEDService(qchat.username, qchat.password, qchat.deviceID, qchat.urlIp);

            //删除群组成员
            GroupMemberRequest gmr = new GroupMemberRequest();
            gmr.memberSize = qchat.memberSize;// 2;
            gmr.groupCode = qchat.groupCode;// "zppaam678685";
            GroupMemberInfo[] groupMemberCollection = new GroupMemberInfo[1];
            GroupMemberInfo groupmember1 = new GroupMemberInfo();

            groupmember1.number = qchat.number_mem;// "15314604085";
            groupmember1.type = qchat.type_mem;// 1;
            groupmember1.name = qchat.name_mem;// "testname";
            groupmember1.level = qchat.lebel;// 4;

            groupMemberCollection[0] = groupmember1;
            gmr.gMemInfo = groupMemberCollection;
            QedRequest qedr = new QedRequest();
            qedr.groupMemRequest = gmr;

            StringBuilder sb = new StringBuilder();
            QedResponse response = qqs.deleteGroupMember(qedr);

            GroupMemberResponse gresponse = response.groupMemResponse;
            if (gresponse != null && gresponse.response != null)
            {
                sb.AppendLine("Count: " + gresponse.count);
                for (int i = 0; i < gresponse.count; i++)
                {
                    sb.AppendLine("description:" + gresponse.response[i].description);
                    sb.AppendLine("reserve:" + gresponse.response[i].reserve);
                    sb.AppendLine("returnCode: " + gresponse.response[i].returnCode);
                }
            }
            else
            {
                sb.AppendLine("返回信息为null");
            }
            Console.WriteLine(sb);

            //Console.ReadKey();
            return sb.ToString();
        }
Пример #3
0
        public void telecomDelete(string oneLine, string operatorName, string localRoomId, string serverRoomId)
        {
            QChat_GroupMember stQchatGroupMember = new QChat_GroupMember();
            string RetStr = null;
            string groupNum = TelecomGroupNum;

            int index = oneLine.LastIndexOf(';');
            string[] phones = oneLine.Substring(0, index).Split(';');

            stQchatGroupMember.username = TelecomUserName;
            stQchatGroupMember.password = TelecomPassword;
            stQchatGroupMember.deviceID = TelecomDeviceId;
            stQchatGroupMember.urlIp = TelecomUrlIp;
            stQchatGroupMember.memberSize = 2;
            stQchatGroupMember.groupCode = groupNum;
            stQchatGroupMember.type_mem = 1;
            stQchatGroupMember.lebel = 4;

            int i;
            for (i = 0; i < phones.Length; i++)
            {
                stQchatGroupMember.number_mem = phones[i];
                RetStr = telecomManager.DeleteGroupMember(stQchatGroupMember);
                if ((!string.IsNullOrEmpty(RetStr))
                    && (RetStr.IndexOf("成功") > 0))
                {
                    string msg = string.Empty;
                    msg += "OPERATION:DELETEMEMBERACK" + "\r\n"
                         + "OPERATORNAME:" + operatorName + "\r\n"
                         + "SERVERROOMID:" + serverRoomId + "\r\n"
                         + "LOCALCONFROOMID:" + localRoomId + "\r\n"
                         + "TYPE:TELECOM" + "\r\n"
                         + "STATUS:OK" + "\r\n"
                         + "NUMBER:" + phones[i] + "\r\n";
                    myGlobals.msgBus.sendMessage(msg);
                }
                else
                {
                    string msg = string.Empty;
                    msg += "OPERATION:DELETEMEMBERACK" + "\r\n"
                         + "OPERATORNAME:" + operatorName + "\r\n"
                         + "SERVERROOMID:" + serverRoomId + "\r\n"
                         + "LOCALCONFROOMID:" + localRoomId + "\r\n"
                         + "TYPE:TELECOM" + "\r\n"
                         + "STATUS:FAILED" + "\r\n"
                         + "NUMBER:" + phones[i] + "\r\n";
                    myGlobals.msgBus.sendMessage(msg);
                }
            }

        }