Esempio n. 1
0
        public static CommentResponse delAccount(DelAccountInfo info)
        {
            string          _uri   = ECConstUri.account_uri + string.Format("?userId={0}&accountId={1}", info.userId, info.accountId);
            CommentResponse result = eSDKServiceHelper.CallService <CommentResponse>(_uri, HttpMethod.DELETE);

            return(result);
        }
Esempio n. 2
0
        //修改部门
        private void btn_editDepartment_Click(object sender, EventArgs e)
        {
            try
            {
                DepartmentInfo _info = new DepartmentInfo();
                _info.userId         = this.txt_Account.Text.Trim();
                _info.departmentName = this.txt_departmentName.Text.Trim();
                _info.parentId       = this.txt_parentId.Text.Trim();
                _info.departmentId   = this.txt_departmentId.Text.Trim();

                CommentResponse result = ecBusiness.EditDepartment(_info);
                if (result != null)
                {
                    this.txt_ResultCode.Text = result.resultCode;
                    this.txt_Content.Text    = result.resultContext;
                    this.txt_ResultInfo.Text = eSDKServiceHelper.GetJsonString(result);
                    if (result.resultCode == "0")
                    {
                        this.WriteLog("call edit department success.");
                    }
                    else
                    {
                        this.WriteLog("call edit department failed," + result.resultContext);
                    }
                }
                else
                {
                    this.WriteLog("call edit department fail,response is null.");
                }
            }
            catch (Exception ex)
            {
                this.WriteLog("call edit department fail," + ex.Message);
            }
        }
Esempio n. 3
0
        //修改账户
        private void btn_editAccount_Click(object sender, EventArgs e)
        {
            try
            {
                EditAccountInfo _info = new EditAccountInfo();
                _info.userId = this.txt_AccountId.Text.Trim();
                EditAccount editAccount = new EditAccount();
                editAccount.accountType  = this.cbx_accountType.Text.Trim();
                editAccount.accountId    = this.txt_accountIdEx.Text.Trim();
                editAccount.name         = this.txt_accountName.Text.Trim();
                editAccount.roleId       = this.txt_roleId.Text.Trim();
                editAccount.userLevel    = this.txt_levelId.Text.Trim();
                editAccount.departmentId = this.txt_dpId.Text.Trim();
                editAccount.addr         = "asdfaf";
                editAccount.cellPhone    = "13911111111";
                editAccount.email        = "*****@*****.**";
                editAccount.fax          = "33333333";
                editAccount.homePhone    = "051211111111";
                editAccount.officePhone  = "051266666666";
                editAccount.otherPhone   = "123123123";
                editAccount.sex          = "1";
                editAccount.shortPhone   = "051295552";
                editAccount.title        = "software engineer";
                _info.account            = editAccount;

                CommentResponse result = ecBusiness.EditAccount(_info);
                if (result != null)
                {
                    this.txt_ResultCode.Text = result.resultCode;
                    this.txt_Content.Text    = result.resultContext;
                    this.txt_ResultInfo.Text = eSDKServiceHelper.GetJsonString(result);
                    if (result.resultCode == "0")
                    {
                        this.WriteLog("call edit account success.");
                    }
                    else
                    {
                        this.WriteLog("call edit account failed," + result.resultContext);
                    }
                }
                else
                {
                    this.WriteLog("call edit account fail,response is null.");
                }
            }
            catch (Exception ex)
            {
                this.WriteLog("call edit account fail," + ex.Message);
            }
        }
Esempio n. 4
0
        //删除SIP号码
        private void btn_delSipNumber_Click(object sender, EventArgs e)
        {
            try
            {
                DelSipNumber _info = new DelSipNumber();
                _info.userId = this.txt_sipUser.Text.Trim();

                delSipNumber info = new delSipNumber();
                info.gwIp        = this.txt_gwIp.Text.Trim();
                info.number      = this.txt_SipNumber.Text.Trim();
                info.deleteSipUe = this.cbx_deleteSipUe.Text.Trim();

                _info.sip = info;

                CommentResponse result = ecBusiness.DelSipNumber(_info);
                if (result != null)
                {
                    this.txt_ResultCode.Text = result.resultCode;
                    this.txt_Content.Text    = result.resultContext;
                    this.txt_ResultInfo.Text = eSDKServiceHelper.GetJsonString(result);
                    if (result.resultCode == "0")
                    {
                        this.WriteLog("call del sip number success.");
                    }
                    else
                    {
                        this.WriteLog("call del sip number failed," + result.resultContext);
                    }
                }
                else
                {
                    this.WriteLog("call del sip number fail,response is null.");
                }
            }
            catch (Exception ex)
            {
                this.WriteLog("call del sip number fail," + ex.Message);
            }
        }
Esempio n. 5
0
        public static CommentResponse delSipNumber(DelSipNumber info)
        {
            CommentResponse result = eSDKServiceHelper.CallService <CommentResponse>(ECConstUri.delSip_uri, HttpMethod.POST, info);

            return(result);
        }
Esempio n. 6
0
        public static CommentResponse editSipNumber(AddSIPInfo info)
        {
            CommentResponse result = eSDKServiceHelper.CallService <CommentResponse>(ECConstUri.sip_uri, HttpMethod.PUT, info);

            return(result);
        }
Esempio n. 7
0
        public static CommentResponse editAccount(EditAccountInfo info)
        {
            CommentResponse result = eSDKServiceHelper.CallService <CommentResponse>(ECConstUri.account_uri, HttpMethod.PUT, info);

            return(result);
        }
Esempio n. 8
0
        /// <summary>
        /// 删除账户
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public CommentResponse DelAccount(DelAccountInfo info)
        {
            CommentResponse result = eSDKServiceHelper.delAccount(info);

            return(result);
        }
Esempio n. 9
0
        /// <summary>
        /// 修改账户
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public CommentResponse EditAccount(EditAccountInfo info)
        {
            CommentResponse result = eSDKServiceHelper.editAccount(info);

            return(result);
        }
Esempio n. 10
0
        /// <summary>
        /// 删除账户
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public CommentResponse DelSipNumber(DelSipNumber info)
        {
            CommentResponse result = eSDKServiceHelper.delSipNumber(info);

            return(result);
        }
Esempio n. 11
0
        /// <summary>
        /// 修改账户
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public CommentResponse EditSipNumber(AddSIPInfo info)
        {
            CommentResponse result = eSDKServiceHelper.editSipNumber(info);

            return(result);
        }
Esempio n. 12
0
        //修改SIP号码
        private void btn_editSipNumber_Click(object sender, EventArgs e)
        {
            try
            {
                AddSIPInfo _info = new AddSIPInfo();
                _info.userId = this.txt_sipUser.Text.Trim();

                SIPAccount _account = new SIPAccount();
                _account.gwIp            = this.txt_gwIp.Text.Trim();
                _account.joint           = this.cbx_isJoint.Text.Trim();
                _account.number          = this.txt_SipNumber.Text.Trim();
                _account.rightLevel      = this.cbx_rightLevel.Text.Trim();
                _account.addPrefix       = this.cbx_addPrefix.Text.Trim();
                _account.ueType          = this.cbx_deviceType.Text.Trim();
                _account.subPbx          = "1";
                _account.longNum         = "14";
                _account.localGwIp       = "";
                _account.sipUe           = "100018695237";
                _account.bOutgoingRights = "";
                _account.cOutgoingRights = "";

                SIPAuth _auth = new SIPAuth();
                _auth.type     = this.cbx_authType.Text.Trim();
                _auth.password = this.txt_authPw5.Text.Trim();
                _auth.ip       = this.txt_authIp.Text.Trim();

                UsmSip _usmSip = new UsmSip();
                _usmSip.crgName          = "";
                _usmSip.domainName       = "";
                _usmSip.sipServerId      = "";
                _usmSip.isSyncLocalGw    = "";
                _usmSip.localGwName      = "";
                _usmSip.mrGroupName      = "";
                _usmSip.sourceCode       = "";
                _usmSip.stationGroupName = "";

                _account.sipAuth = _auth;
                _account.usmSip  = _usmSip;
                _info.sip        = _account;

                CommentResponse result = ecBusiness.EditSipNumber(_info);
                if (result != null)
                {
                    this.txt_ResultCode.Text = result.resultCode;
                    this.txt_Content.Text    = result.resultContext;
                    this.txt_ResultInfo.Text = eSDKServiceHelper.GetJsonString(result);
                    if (result.resultCode == "0")
                    {
                        this.WriteLog("call edit sip number success.");
                    }
                    else
                    {
                        this.WriteLog("call edit sip number failed," + result.resultContext);
                    }
                }
                else
                {
                    this.WriteLog("call edit sip number fail,response is null.");
                }
            }
            catch (Exception ex)
            {
                this.WriteLog("call edit sip number fail," + ex.Message);
            }
        }