Example #1
0
        //9.2.3	删除群组
        public string deleteGroup(QChat_Group qchat)
        {
            QchatQEDService qqs = new QchatQEDService();

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

            //6删除群组
            GroupRequest deleteRequest = new GroupRequest();
            GroupInfo    gi2           = new GroupInfo();

            gi2.code = qchat.code;//"gmikym193313";
            deleteRequest.groupInfo = gi2;
            QedRequest qedr_del = new QedRequest();

            qedr_del.groupRequest = deleteRequest;
            QedResponse   response        = qqs.deleteGroup(qedr_del);
            GroupResponse companyResponse = response.groupResponse;
            StringBuilder sb = new StringBuilder();

            if (companyResponse != null)//&& companyResponse.response != null)
            {
                sb.AppendLine("Response:" + companyResponse.response.description.ToString());
                sb.AppendLine("reserve:" + companyResponse.response.reserve);
                sb.AppendLine("returnCode:" + companyResponse.response.returnCode);
            }
            else
            {
                sb.AppendLine("返回信息为null");
            }
            Console.WriteLine(sb);

            //Console.ReadKey();
            return(sb.ToString());
        }
Example #2
0
        //9.1.3	查询集团用户
        public string QueryCompanyUser(QChat_Query qchat)
        {
            QchatQEDService qqs = new QchatQEDService();

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

            //查询参数
            QueryRequest queryRequest = new QueryRequest();

            queryRequest.mainParam = qchat.mainParam; //"xghcnc933731"; //为管理员名称
            queryRequest.pageSize  = qchat.pageSize;  //10; //查询条数,默认为10
            queryRequest.startPos  = qchat.startPos;  //0; //起始位置
            QedRequest qedr = new QedRequest();

            qedr.queryRequest = queryRequest;

            QedResponse         response        = qqs.queryCompanyUser(qedr);
            CompanyUserResponse companyResponse = response.companyUserResponse;
            StringBuilder       sb = new StringBuilder();

            if (companyResponse != null && companyResponse.userInfo != null)
            {
                sb.AppendLine("count:" + companyResponse.count.ToString());
                sb.AppendLine("Response:" + companyResponse.response.description.ToString());
                sb.AppendLine("reserve:" + companyResponse.response.reserve);
                sb.AppendLine("returnCode:" + companyResponse.response.returnCode);

                sb.AppendLine("groupInfo:" + companyResponse.userInfo.ToString());
                for (int i = 0; i < companyResponse.userInfo.Length; i++)
                {
                    sb.AppendLine("用户" + i);
                    sb.AppendLine("domain:" + companyResponse.userInfo[i].domain);
                    sb.AppendLine("callRestriction:" + companyResponse.userInfo[i].callRestriction);
                    sb.AppendLine("imsi:" + companyResponse.userInfo[i].imsi);
                    sb.AppendLine("level:" + companyResponse.userInfo[i].level);
                    sb.AppendLine("name:" + companyResponse.userInfo[i].name);
                    sb.AppendLine("number:" + companyResponse.userInfo[i].number);
                    sb.AppendLine("password:"******"status:" + companyResponse.userInfo[i].status);
                }
            }
            else
            {
                sb.AppendLine("返回信息为null");
            }
            Console.WriteLine(sb);

            //Console.ReadKey();
            return(sb.ToString());
        }
Example #3
0
        //9.1.2	查询集团预定义组
        public string QueryCompanyGroup(QChat_Query qchat)
        {
            QchatQEDService qqs = new QchatQEDService();

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

            //查询参数
            QueryRequest queryRequest = new QueryRequest();

            queryRequest.mainParam = qchat.mainParam; //"xghcnc933731"; //为管理员名称
            queryRequest.pageSize  = qchat.pageSize;  //10; //查询条数,默认为10
            queryRequest.startPos  = qchat.startPos;  //0; //起始位置
            QedRequest qedr = new QedRequest();

            qedr.queryRequest = queryRequest;

            QedResponse          response        = qqs.queryCompanyGroup(qedr);
            CompanyGroupResponse companyResponse = response.companyGroupResponse;
            StringBuilder        sb = new StringBuilder();

            if (companyResponse != null && companyResponse.groupInfo != null)
            {
                sb.AppendLine("count:" + companyResponse.count.ToString());
                sb.AppendLine("Response:" + companyResponse.response.description.ToString());
                sb.AppendLine("reserve:" + companyResponse.response.reserve);
                sb.AppendLine("returnCode:" + companyResponse.response.returnCode + "\n");

                sb.AppendLine("groupInfo: " + companyResponse.groupInfo.ToString());

                for (int i = 0; i < companyResponse.groupInfo.Length; i++)
                {
                    sb.AppendLine("结果" + i);
                    sb.AppendLine("code:" + companyResponse.groupInfo[i].code);
                    sb.AppendLine("domain:" + companyResponse.groupInfo[i].domain);
                    sb.AppendLine("memberCount:" + companyResponse.groupInfo[i].memberCount.ToString());
                    sb.AppendLine("name:" + companyResponse.groupInfo[i].name);
                    sb.AppendLine("policy:" + companyResponse.groupInfo[i].policy);
                    sb.AppendLine("title: " + companyResponse.groupInfo[i].title);
                    sb.AppendLine("type:" + companyResponse.groupInfo[i].type.ToString());
                }
            }
            else
            {
                sb.AppendLine("返回信息为null");
            }
            Console.WriteLine(sb);

            //Console.ReadKey();
            return(sb.ToString());
        }
Example #4
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());
        }
Example #5
0
        //9.2.5	查询群组成员
        public string queryGroupMember(QChat_Query qchat)
        {
            QchatQEDService qqs = new QchatQEDService();

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

            //查询群组成员
            QueryRequest queryMemRequest = new QueryRequest();

            queryMemRequest.mainParam = qchat.mainParam; // "xghcnc933731"; //为管理员名称
            queryMemRequest.pageSize  = qchat.pageSize;  // 10; //查询条数,默认为10
            queryMemRequest.startPos  = qchat.startPos;  // 0; //起始位置
            QedRequest qedr_query = new QedRequest();

            qedr_query.queryRequest = queryMemRequest;

            QedResponse response = qqs.queryGroupMember(qedr_query);
            QueryGroupMemberResponse companyResponse = response.QGMemResponse;
            StringBuilder            sb = new StringBuilder();

            if (companyResponse != null && companyResponse.response != null)
            {
                sb.AppendLine("count:" + companyResponse.count);
                sb.AppendLine("Response:" + companyResponse.response.description.ToString());
                sb.AppendLine("reserve:" + companyResponse.response.reserve);
                sb.AppendLine("returnCode:" + companyResponse.response.returnCode);
                //kzs?为什么为空
                if (companyResponse.gMemInfo != null)
                {
                    for (int i = 0; i < companyResponse.gMemInfo.Length; i++)
                    {
                        sb.AppendLine("成员" + (i + 1));
                        sb.AppendLine("number:" + companyResponse.gMemInfo[i].number);
                        sb.AppendLine("name:" + companyResponse.gMemInfo[i].name);
                        sb.AppendLine("level:" + companyResponse.gMemInfo[i].level);
                        sb.AppendLine("type:" + companyResponse.gMemInfo[i].type);
                    }
                }
            }
            else
            {
                sb.AppendLine("返回信息为null");
            }
            Console.WriteLine(sb);

            //Console.ReadKey();
            return(sb.ToString());
        }
Example #6
0
        //9.2.2	增加群组
        public string AddGroup(QChat_Group qchat)
        {
            QchatQEDService qqs = new QchatQEDService();

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

            //增加参数
            AddGroupRequest queryRequest_add = new AddGroupRequest();
            GroupInfo       gi = new GroupInfo();

            gi.name        = qchat.name;                        //"test";
            gi.title       = qchat.title;                       //"title";
            gi.memberCount = qchat.memberCount;                 //20;
            gi.type        = qchat.type;                        //2;
            gi.policy      = "2";                               //固定
            gi.domain      = (gi.type == 2 ? "2" : "3");;
            gi.codec       = 2;                                 //固定
            gi.code        = string.Empty;                      //固定

            queryRequest_add.adminAccount = qchat.adminAccount; //"admin057100622"; //集团管理员名称
            queryRequest_add.groupInfo    = gi;

            QedRequest qedr_add = new QedRequest();

            qedr_add.addGroupRequest = queryRequest_add;

            QedResponse   response        = qqs.addGroup(qedr_add);
            GroupResponse companyResponse = response.groupResponse;
            StringBuilder sb = new StringBuilder();

            if (companyResponse != null && companyResponse.response != null)
            {
                sb.AppendLine("Response:" + companyResponse.response.description.ToString());
                sb.AppendLine("reserve:" + companyResponse.response.reserve);
                sb.AppendLine("returnCode:" + companyResponse.response.returnCode);
            }
            else
            {
                sb.AppendLine("返回信息为null");
            }
            Console.WriteLine(sb);

            //Console.ReadKey();
            return(sb.ToString());
        }
Example #7
0
        //9.3.3	修改用户
        public string updateUser(QChat_User qchat)
        {
            QchatQEDService qqs = new QchatQEDService();

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


            //修改用户
            UserRequest userequest = new UserRequest();
            UserInfo    ui         = new UserInfo();

            ui.callRestriction  = qchat.callRestriction; //"1111111111";
            ui.level            = qchat.level;           //"3";
            ui.number           = qchat.number_user;     //"15314604129";
            ui.password         = qchat.password_user;   //"abcdef1111";
            userequest.userInfo = ui;

            QedRequest qedr = new QedRequest();

            qedr.userRequest = userequest;

            QedResponse  response     = qqs.updateUser(qedr);
            UserResponse userresponse = response.userResponse;

            StringBuilder sb = new StringBuilder();

            if (userresponse.response != null)
            {
                sb.AppendLine("description" + userresponse.response.description);
                sb.AppendLine("reserve:" + userresponse.response.reserve);
                sb.AppendLine("returnCode:" + userresponse.response.returnCode);
            }
            else
            {
                sb.AppendLine("返回信息为null");
            }
            Console.WriteLine(sb);

            //Console.ReadKey();
            return(sb.ToString());
        }
Example #8
0
        //9.1.1	查询集团
        public string QueryCompany(QChat_Query qchat)
        {
            QchatQEDService qqs = new QchatQEDService();

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

            //查询参数
            QueryRequest queryRequest = new QueryRequest();

            queryRequest.mainParam = qchat.mainParam; //"xghcnc933731"; //为管理员名称
            queryRequest.pageSize  = qchat.pageSize;  //10; //查询条数,默认为10
            queryRequest.startPos  = qchat.startPos;  //0; //起始位置
            QedRequest qedr = new QedRequest();

            qedr.queryRequest = queryRequest;

            QedResponse     response        = qqs.queryCompany(qedr);
            CompanyResponse companyResponse = response.companyResponse;
            StringBuilder   sb = new StringBuilder();

            if (companyResponse != null && companyResponse.companyInfo != null)
            {
                sb.AppendLine("adminCount:" + companyResponse.companyInfo.adminCount.ToString());
                sb.AppendLine("companyName:" + companyResponse.companyInfo.companyName.ToString());
                sb.AppendLine("groupCount:" + companyResponse.companyInfo.groupCount.ToString());
                sb.AppendLine("userCount:" + companyResponse.companyInfo.userCount.ToString());
                sb.AppendLine("Response:" + companyResponse.response.description.ToString());
                sb.AppendLine("reserve:" + companyResponse.response.reserve);
                sb.AppendLine("returnCode:" + companyResponse.response.returnCode);
            }
            else
            {
                sb.AppendLine("返回信息为null");
            }
            Console.WriteLine(sb);
            //Console.ReadKey();

            return(sb.ToString());
        }
Example #9
0
        //9.2.4	修改群组
        public string updateGroup(QChat_Group qchat)
        {
            QchatQEDService qqs = new QchatQEDService();

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

            //7修改群组
            GroupRequest updateRequest = new GroupRequest();
            GroupInfo    gi3           = new GroupInfo();

            gi3.name                = qchat.name;        //"123";
            gi3.memberCount         = qchat.memberCount; //101;
            gi3.code                = qchat.code;        // "zppaam678685";
            gi3.title               = qchat.title;       // "title";
            updateRequest.groupInfo = gi3;
            QedRequest qedr_update = new QedRequest();

            qedr_update.groupRequest = updateRequest;
            QedResponse   response        = qqs.updateGroup(qedr_update);
            GroupResponse companyResponse = response.groupResponse;
            StringBuilder sb = new StringBuilder();

            if (companyResponse != null && companyResponse.response != null)
            {
                sb.AppendLine("Response:" + companyResponse.response.description.ToString());
                sb.AppendLine("reserve:" + companyResponse.response.reserve);
                sb.AppendLine("returnCode:" + companyResponse.response.returnCode);
            }
            else
            {
                sb.AppendLine("返回信息为null");
            }
            Console.WriteLine(sb);

            //Console.ReadKey();
            return(sb.ToString());
        }