private void SendMsg()
        {
            string content = rtxtInputBox.Text.Trim();

            if (content == "")
            {
                MessageBoxAdapter.ShowInfo("发送内容不能为空,请重新输入");
                rtxtInputBox.Text = "";
                return;
            }
            string openId  = this.Name;
            string url     = TheMotherWin.WeiXinOfServiceOnlineInovkeAddress + "/api/share/v1/SendWXMessage";
            string payLoad = new WXRequestTextMessage {
                touser = openId, msgtype = WXRequestMessageType.text.ToString(), text = new WXTextMessageWrapper {
                    content = content
                }
            }.ToJson();

            HttpAdapter.postAsyncStr(url, payLoad, (ret1, res1) =>
            {
                webBrowser.Document.InvokeScript("sendMsg", new object[] { content });
                rtxtInputBox.Text = "";
            }, (he) =>
            {
                MessageBoxAdapter.ShowInfo("发送失败:" + he.Message);
            });
        }
Пример #2
0
 private void btnTest_Click(object sender, EventArgs e)
 {
     if (testPlatformReady())
     {
         MessageBoxAdapter.ShowInfo("连接成功", Properties.Settings.Default.MessageBoxTitle);
     }
 }
Пример #3
0
 private void btnTest_Click(object sender, EventArgs e)
 {
     if (ConnectRemoteHost())
     {
         MessageBoxAdapter.ShowInfo("连接成功", Properties.Settings.Default.MessageBoxTitle);
     }
 }
Пример #4
0
        private void FetchBookMeal(Button btn)
        {
            string mealType  = btn.Name.Substring(btn.Name.Length - 5);
            string setMealId = btn.Tag as string;

            HttpAdapter.postSyncAsJSON(SettingsVar.DataExchangePoint + "/Pam/PamService/PAFetchBookMeal", new { OldManId = _OldManId.ToGuid(), MealType = mealType, SetMealId = setMealId, OperatedBy = Data.UserId }.ToStringObjectDictionary(), new { PACode = SettingsVar.BindingPACode, ApplicationId = Common.APPLICATION_ID }.ToStringObjectDictionary(), (ret, res) =>
            {
                if ((bool)ret.Success)
                {
                    MessageBoxAdapter.ShowInfo("领取配餐成功");
                    BookMealInfo bookMealInfo = Data.BookMeals.Single(item => item.OldManId == _OldManId && item.MealType == mealType && item.SetMealId == setMealId);
                    bookMealInfo.FetchFlag    = "1";

                    if (Common.isInExhibition)
                    {
                        btn.ForeColor = SystemColors.ControlText;
                        btn.Enabled   = true;
                        btn.Text      = "循环使用";
                    }
                    else
                    {
                        btn.ForeColor = SystemColors.ControlLight;
                        btn.Enabled   = false;
                        btn.Text      = "确认领餐";
                    }
                }
                else
                {
                    MessageBoxAdapter.ShowError((string)ret.ErrorMessage);
                }
            });
        }
Пример #5
0
        public bool InvokeTransferPhone(int phoneType, string phoneNo, string message)
        {
            bool result = false;

            if (MakeCall != null)
            {
                if (EnvironmentVar.DialBackFlag == "1")
                {
                    MessageBoxAdapter.ShowInfo("请用手机或者其余的座机进行回拨");
                    return(false);
                }

                //if (!TheMotherWin.isSignInToIPCC)
                //{
                //    MessageBoxAdapter.ShowInfo("请确保已登录到IPCC或座席处于空闲状态!");
                //    return false;
                //}

                if (phoneType == 98)
                {
                    //回拨老人电话
                    frmCallsDialog calldialog = new frmCallsDialog();
                    object         oRets      = webBrowser.Document.InvokeScript("getServiceObjectPhoneNos", new object[] { PageData.CallServiceId.ToString() });
                    if (oRets != null && oRets.ToString() != "[]")
                    {
                        List <string> phoneNos = JsonConvert.DeserializeObject <List <string> >(oRets.ToString());
                        calldialog.PhoneNos     = phoneNos;
                        calldialog.ChooseCallNo = phoneNo;
                    }
                    if (calldialog.PhoneNos != null && calldialog.PhoneNos.Count > 1)
                    {
                        calldialog.ShowDialog();
                        if (calldialog.DialogResult == System.Windows.Forms.DialogResult.OK)
                        {
                            phoneNo = calldialog.ChooseCallNo;
                        }
                        else
                        {
                            //主动撤销
                            return(false);
                        }
                    }
                }
                MakeCallEventArgs tpe = new MakeCallEventArgs {
                    CallServiceId = PageData.CallServiceId, Uuid = PageData.UuidOfIPCC, PhoneType = phoneType, PhoneNo = phoneNo, Message = message
                };
                MakeCall(this, tpe);
                if (!tpe.Cancel)
                {
                    //没有取消,则记录日志
                    result = true;
                }
            }
            return(result);
        }
Пример #6
0
        private void btnMakeCard_Click(object sender, EventArgs e)
        {
            _icAPI.Beep();
            int sector = 0;

            if (_icAPI.AuthenticationKey(sector))
            {
                int address = 1;

                string read1 = _icAPI.ReadIC16Byte(address);
                string read2 = _icAPI.ReadIC16Byte(address + 1);
                string raw   = read1 + read2;
                int    ret0  = _icAPI.WriteIC(address, _IDNo);
                if (ret0 == 0)
                {
                    HttpAdapter.postSyncAsJSON(SettingsVar.DataExchangePoint + "/Pam/PamService/PAMakeCard", new { OldManId = _OldManId.ToGuid(), OperatedBy = Data.UserId, ICNo = _CurrentICNo }.ToStringObjectDictionary(), new { PACode = SettingsVar.BindingPACode, ApplicationId = Common.APPLICATION_ID }.ToStringObjectDictionary(), (ret, res) =>
                    {
                        if ((bool)ret.Success)
                        {
                            MessageBoxAdapter.ShowInfo("制卡成功");
                            lblTip.Text           = "制卡成功";
                            OldManInfo oldmanInfo = Data.OldMans.SingleOrDefault(item => item.OldManId == _OldManId);
                            if (oldmanInfo != null)
                            {
                                oldmanInfo.ICNo = _CurrentICNo;
                                lblICNo.Text    = _CurrentICNo;
                            }
                            isStop            = true;
                            this.DialogResult = System.Windows.Forms.DialogResult.OK;
                        }
                        else
                        {
                            ret0 = _icAPI.WriteIC(address, raw);
                            MessageBoxAdapter.ShowError((string)ret.ErrorMessage);
                        }
                    });
                }
                else
                {
                    MessageBoxAdapter.ShowError("写入卡失败" + ret0.ToString());
                }
            }
            else
            {
                MessageBoxAdapter.ShowError("验证密码失败");
            }
        }
Пример #7
0
        private void btnAreaSync_Click(object sender, EventArgs e)
        {
            //远程获取deployNodeObjects
            string authDataPoint = INIAdapter.ReadValue(Common.CFG_SECTION_WEB, Common.CFG_KEY_AUTH_DATA_POINT, Common.CFG_FILE_PATH);

            ThreadAdapter.DoOnceTask(() =>
            {
                HttpAdapter.getSyncTo(authDataPoint + "/GetDeployNodeObjects", (ret, res) =>
                {
                    if ((bool)ret.Success)
                    {
                        string strDeployNodeObjects = JsonConvert.SerializeObject(ret.rows);
                        INIAdapter.WriteValue(Common.INI_SECTION_DATA, Common.INI_KEY_DEPLOY_NODE_OBJECTS, strDeployNodeObjects, Common.INI_FILE_PATH);
                        MessageBoxAdapter.ShowInfo("区域同步成功");
                    }
                    else
                    {
                        MessageBoxAdapter.ShowError(ret.ErrorMessage.ToString());
                    }
                });
            });
        }
Пример #8
0
 private void ReloadBookMeals()
 {
     this.UIDoOnceTask(() =>
     {
         HttpAdapter.getSyncTo(SettingsVar.DataExchangePoint + "/Pam/PamService/GetOldManBookMealForToday", null, new { ApplicationId = Common.APPLICATION_ID, PACode = SettingsVar.BindingPACode }.ToStringObjectDictionary(), (ret, res) =>
         {
             if ((bool)ret.Success)
             {
                 Data.BookMeals = new List <BookMealInfo>();
                 foreach (var row in ret.rows)
                 {
                     dynamic item = new ExpandoObject();
                     DynamicAdapter.Parse(item, XElement.Parse(row.ToString()));
                     Data.BookMeals.Add((item.StringObjectDictionary as IDictionary <string, object>).FromDynamic <BookMealInfo>());
                 }
                 MessageBoxAdapter.ShowInfo("更新配餐信息成功!");
             }
             else
             {
                 lblTip.Text = "更新配餐信息失败:" + (string)ret.ErrorCode;
             }
         });
     });
 }
Пример #9
0
        private void btnTestSpeed_Click(object sender, EventArgs e)
        {
            string oldText = btnTestSpeed.Text;

            btnTestSpeed.Enabled   = false;
            testSpeedLoadingThread = ThreadAdapter.DoCircleTask(() =>
            {
                BeginInvoke(new Action(() =>
                {
                    if (btnTestSpeed.Text.IndexOf(".") == -1)
                    {
                        btnTestSpeed.Text += ".";
                    }
                    else if (btnTestSpeed.Text.IndexOf(".") + 3 == btnTestSpeed.Text.Length)
                    {
                        btnTestSpeed.Text = btnTestSpeed.Text.Substring(0, btnTestSpeed.Text.Length - 3);
                    }
                    else
                    {
                        btnTestSpeed.Text += ".";
                    }
                }));
            }, 700, () =>
            {
                return(btnTestSpeed.Enabled);
            });

            string commandStr = string.Format("iperf.exe -c {0} -p 12347 -t 10 -y C", callCenterIP);

            CommandLineAdapter.Execute(commandStr, (o, dre) =>
            {
                string output = dre.Data;
                if (!string.IsNullOrEmpty(output))
                {
                    if (output.Contains("fail") || output.Contains("timed out"))
                    {
                        MessageBoxAdapter.ShowError("无法连接到呼叫中心,请检查网络!");
                    }
                    else
                    {
                        string[] results = output.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                        if (results.Length == 9)
                        {
                            long bps = long.Parse(results[8]) / 8 / 1024;
                            MessageBoxAdapter.ShowInfo("连接到呼叫中心的即时速度为【" + bps.ToString() + "k】!");
                        }
                    }
                }

                if (!String.IsNullOrEmpty(dre.Data))
                {
                    Console.WriteLine(dre.Data);
                }
            }, "./tools", (o, ee) =>
            {
                BeginInvoke(new Action(() =>
                {
                    btnTestSpeed.Enabled = true;
                    btnTestSpeed.Text    = oldText;
                }));
            });
        }