Ejemplo n.º 1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (!CheckExtNo())
            {
                return;
            }
            string transfer_num  = rbExt.Checked ? txtTransferExtNo.Text.Trim() : e0571.web.core.Utils.TypeConverter.ChangeString((cbTransferQueues.SelectedItem as ListItem).Value);
            string urlToTransfer = TheMotherWin.getIPCCInterface4EComm("transfer", new Dictionary <string, string> {
                { "ext_no", EnvironmentVar.ExtCode }, { "transfer_num", transfer_num }
            });

            HttpAdapter.getAsyncTo(urlToTransfer, (result0, response0) =>
            {
                Console.WriteLine(string.Format("################### transfer {0}:{1}", transfer_num, result0));
                if (result0 == "+OK")
                {
                    BeginInvoke(new Action(() =>
                    {
                        this.Close();
                    }));
                }
                else
                {
                    MessageBoxAdapter.ShowDebug(result0);
                }
            });
        }
Ejemplo n.º 2
0
        private void InitSms()
        {
            HttpAdapter.getAsyncTo(smsEndPoint + "/GetCityDeployNodes", null, new { ApplicationId = "CS001" }.ToStringObjectDictionary(), (ret, res) =>
            {
                if ((bool)ret.Success)
                {
                    if (ret.rows != null && ret.rows.lenght > 0)
                    {
                        _MessageLoopForSendSms_Call(ret.rows);
                        _MessageLoopForGetSms_Call(ret.rows);

                        //启动短信接收发送机制
                        isRunning = true;
                    }
                }
            });
        }
Ejemplo n.º 3
0
 //获取短信节点个数
 private void _LoopForGetSmsPoint()
 {
     GetSmsPoint_CircleThread = ThreadAdapter.DoCircleTask(() =>
     {
         //验证请求
         HttpAdapter.getAsyncTo(authSmsEndPoint + "/GetCityDeployNodes", null, new { ApplicationId = "CS001" }.ToStringObjectDictionary(), (ret, res) =>
         {
             if ((bool)ret.Success)
             {
                 SendSmsEndPoint sendSmsEndPoint;
                 foreach (var item in ret.rows)
                 {
                     sendSmsEndPoint = new SendSmsEndPoint()
                     {
                         ApplicationId = "CS001"
                     };
                     sendSmsEndPoint.Url    = (string)item.AccessPoint;//"http://localhost/SmartLife.CertManage.SmsServices";//
                     sendSmsEndPoint.NodeId = (string)item.NodeId;
                     sendSmsEndPoint.Token  = (string)item.Token;
                     if (smsPointDic.ContainsKey(sendSmsEndPoint.NodeId))
                     {
                         smsPointDic.TryUpdate(sendSmsEndPoint.NodeId, sendSmsEndPoint, smsPointDic[sendSmsEndPoint.NodeId]);
                     }
                     else
                     {
                         smsPointDic.TryAdd(sendSmsEndPoint.NodeId, sendSmsEndPoint);
                     }
                 }
             }
         });
     },
                                                           30000,
                                                           () =>
     {
         return(false);
     },//永远不停止
                                                           () =>
     {
         return(!bPassValidated);
     }//验证通过开始执行
                                                           );
 }