private void btnOk_Click(object sender, EventArgs e) { string authEndPoint = formatEndPoint(txtAuthEndPoint.Text.Trim()); string smsEndPoint = formatEndPoint(txtSmsEndPoint.Text.Trim()); string ismgEndPoint = formatEndPoint(txtISMGEndPoint.Text.Trim()); string connectUrl = authEndPoint + "/"; HttpAdapter.optionsAsyncTo(connectUrl, new { ApplicationId = "CS001" }.ToStringObjectDictionary(), (ret, res) => { if (ret != "ok") { MessageBoxAdapter.ShowError("无效的认证节点"); return; } if (SectionSettingsSave != null) { SectionSettingsSave(this, new SectionSettingsSaveEventArgs { AuthEndPoint = authEndPoint, SmsEndPoint = smsEndPoint, IsmgEndPoint = ismgEndPoint }); } this.DialogResult = DialogResult.OK; this.UIInvoke(() => { this.Close(); }); }); }
public bool InvokeRemovePhone(int phoneType, string phoneNo, string message) { bool result = false; if (CloseForCountdown) { //当前窗口和电话不对应 MessageBoxAdapter.ShowError("当前窗口马上将自动关闭,无法响应您的操作"); return(result); } if (RemoveCall != null) { RemoveCallEventArgs rpe = new RemoveCallEventArgs { CallServiceId = PageData.CallServiceId, PhoneType = phoneType, PhoneNo = phoneNo, Message = message }; RemoveCall(this, rpe); if (!rpe.Cancel) { //没有取消,则记录日志 result = true; } } return(result); }
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); } }); }
private void btnManager_Connect_Click(object sender, EventArgs e) { string ip = "192.168.1.18"; string login = "******"; string pwd = ""; string ext = "714001"; string queueStr = "71410,71411,71412,71413"; MgrResult ret = MgrAPIWrapper.Manager_Connect(ip, login, pwd, ext, queueStr); if (ret == MgrResult.ok) { MessageBoxAdapter.ShowDebug("connect ok"); } else { MessageBoxAdapter.ShowDebug("connect " + ret.ToString()); } string[] queues = queueStr.Split(",".ToCharArray()); foreach (var queue in queues) { MgrResult ret00 = MgrAPIWrapper.Manager_QueueAdd(ext, queue, "1003", "1003", 0); if (ret00 == MgrResult.ok) { MgrResult ret01 = MgrAPIWrapper.Manager_QueuePause(ext, queue, "1003", "1003", 0); if (ret01 == MgrResult.ok) { } } } }
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); }); }
private bool ConnectRemoteHost() { bool Connected = false; try { HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(formatRemoteHost() + "/" + txtVirPath.Text.Trim() + "/forClient.htm"); request.Method = "GET"; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); if (response.StatusCode.ToString() == "OK") { StreamReader myreader = new StreamReader(response.GetResponseStream(), Encoding.UTF8); string responseText = myreader.ReadToEnd(); Connected = responseText == "ilovesmartlife"; } } catch (Exception ex) { MessageBoxAdapter.ShowError(ex.Message, Properties.Settings.Default.MessageBoxTitle); } return(Connected); }
private void FetchAccessPoints(Action success) { sendReminderUrl = INIAdapter.ReadValue(Common.INI_SECTION_WEB, Common.INI_KEY_SEND_REMINDER_POINT, Common.INI_FILE_PATH); strRunMode = INIAdapter.ReadValue(Common.INI_SECTION_SYSTEM, Common.INI_KEY_RUN_MODE, Common.INI_FILE_PATH); string authEndPoint = INIAdapter.ReadValue(Common.CFG_SECTION_WEB, Common.CFG_KEY_AUTH_END_POINT, Common.CFG_FILE_PATH); //异步认证 byte runMode = byte.Parse(strRunMode);//测试1 正式0 HttpAdapter.postAsyncAsJSON(authEndPoint, new { RunMode = runMode }.ToStringObjectDictionary(), new { ApplicationId = Common.APPLICATION_ID }.ToStringObjectDictionary(), (ret, res) => { if ((bool)ret.Success) { foreach (var accessPoint in ret.ret.AccessPoints) { accessPointParts.Add(new AccessPointPart { ObjectId = accessPoint.ObjectId.ToString(), Url = accessPoint.Url.ToString() }); } if (success != null) { success(); } } else { MessageBoxAdapter.ShowError(ret.ErrorMessage); } }); }
private void btnOk_Click(object sender, EventArgs e) { if (testPlatformReady()) { if (PlatformReady != null) { PlatformReady(this, new PlatformReadyEventArgs { PlatformAddress = formatPlatformAddress() }); } } if (SettingsSave != null) { SettingsSave(this, new SettingsSaveEventArgs { ServiceOnline = chkServiceOnlineFlag.Checked }); } if (dtpStart.Value < dtpEnd.Value) { if (PlayBackTone != null) { PlayBackTone(this, new PlayBackToneEventArgs { PlayTone = cbxPlayTone.Checked, StartPlayTime = dtpStart.Value.ToString("HH:mm"), EndPlayTime = dtpEnd.Value.ToString("HH:mm") }); } } else { MessageBoxAdapter.ShowError("报警起始时间不能大于结束时间!"); } this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); }
private void btnOk_Click(object sender, EventArgs e) { if (txtUserName.Text.Trim() == "") { MessageBoxAdapter.ShowError("请输入商家编号"); return; } if (txtUserName.Text.Trim() != "XLX1") { MessageBoxAdapter.ShowError("非法授权!"); return; } if (txtPassword.Text.Trim() == "") { MessageBoxAdapter.ShowError("请输入密码"); return; } if (CheckExpire()) { DoLogin(txtUserName.Text.Trim(), txtPassword.Text.Trim()); } else { MessageBoxAdapter.ShowError("expired !!!"); } }
private void btnTest_Click(object sender, EventArgs e) { if (testPlatformReady()) { MessageBoxAdapter.ShowInfo("连接成功", Properties.Settings.Default.MessageBoxTitle); } }
private void frmTestTC_IPCC_Load(object sender, EventArgs e) { #region 制厂商SDK bool isSDKOK = false; string msg = ""; string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string sourceOfSDK = Path.Combine(path, @"TC-IPCC");; try { isSDKOK = FileAdapter.CopyDir(sourceOfSDK, path, true); if (!isSDKOK) { msg = "无法加载厂商SDK"; } } catch (Exception ex) { isSDKOK = false; msg = ex.Message; } finally { if (!isSDKOK) { gbInit.Enabled = gbMonitor.Enabled = gbCore.Enabled = gbConf.Enabled = gbSMS.Enabled = isSDKOK; MessageBoxAdapter.ShowDebug(msg); } } #endregion }
public bool InvokeTransferPhone(int phoneType, string phoneNo, string message) { bool result = false; if (CloseForCountdown) { //当前窗口和电话不对应 MessageBoxAdapter.ShowError("当前窗口马上将自动关闭,无法响应您的操作"); return(result); } if (MakeCall != null) { 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); }
private void btnTest_Click(object sender, EventArgs e) { if (ConnectRemoteHost()) { MessageBoxAdapter.ShowInfo("连接成功", Properties.Settings.Default.MessageBoxTitle); } }
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); } }); }
private void btn_ok_Click(object sender, EventArgs e) { string authEndPoint = formatEndPoint(txtAuthEndPoint.Text.Trim()); string authSmsEndPoint = formatEndPoint(txtAuthSmsEndPoint.Text.Trim()); string smsEndPoint = formatEndPoint(txtSmsEndPoint.Text.Trim()); string showError = ""; showError = txt_SpCode.Text.Trim(); if (string.IsNullOrEmpty(showError)) { MessageBoxAdapter.ShowError("企业编号不能为空!"); return; } showError = txt_LoginName.Text.Trim(); if (string.IsNullOrEmpty(showError)) { MessageBoxAdapter.ShowError("用户名不能为空!"); return; } showError = txt_Password.Text.Trim(); if (string.IsNullOrEmpty(showError)) { MessageBoxAdapter.ShowError("密码不能为空!"); return; } string txtSmsSetting = "SpCode=" + txt_SpCode.Text.Trim() + "&LoginName=" + txt_LoginName.Text.Trim() + "&Password="******"/"; HttpAdapter.optionsAsyncTo(connectUrl, new { ApplicationId = "CS001" }.ToStringObjectDictionary(), (ret, res) => { if (ret != "ok") { MessageBoxAdapter.ShowError("无效的认证节点"); return; } if (SectionSettingsSave != null) { SectionSettingsSave(this, new SectionSettingsSaveEventArgs { AuthEndPoint = authEndPoint, AuthSmsEndPoint = authSmsEndPoint, SmsEndPoint = smsEndPoint, TxtSmsSetting = txtSmsSetting, }); } this.DialogResult = DialogResult.OK; this.UIInvoke(() => { this.Close(); }); }); }
private void SubmitData() { if (item != null) { new Action(() => { int doStatus = int.Parse(item.StringObjectDictionary.DoStatus); if (doStatus == 0) { //响应工单 if (MessageBoxAdapter.ShowConfirm("您确定要响应工单吗") == System.Windows.Forms.DialogResult.OK) { //string url = AccessPoint.Replace("http://115.236.175.110:17000/merchantservices", "http://localhost/SmartLife.CertManage.MerchantServices") + "/Oca/WorkOrderService/ResponseWorkOrder"; string url = AccessPoint + "/Oca/WorkOrderService/ResponseWorkOrder"; HttpAdapter.postSyncAsJSON(url, new { WorkOrderId = Guid.Parse(WorkOrderId) }.ToStringObjectDictionary(), new { ApplicationId = Common.APPLICATION_ID, Token = MerchantVar.CurrentMerchant.Token, StationCode = MerchantVar.StationCode, StationId = StationId }.ToStringObjectDictionary(), (ret, res) => { if ((bool)ret.Success) { LastError = null; } else { LastError = ret.ErrorMessage; } }); } else { LastError = Common.ERROR_USER_CANCEL; } } }).BeginInvoke(new AsyncCallback((ar) => { //AsyncResult result = (AsyncResult)ar; this.UIInvoke(() => { xLoadingPanel.Stop(); if (!string.IsNullOrEmpty(LastError)) { if (LastError != Common.ERROR_USER_CANCEL) { MessageBoxAdapter.ShowError(LastError); } } else { this.DialogResult = DialogResult.OK; this.Close(); } }); }), null); xLoadingPanel.Start(); } }
private void btnSetEventCallback_Click(object sender, EventArgs e) { //MgrAPIWrapper.SetEventCallback(Callback);//自动释放 myCallBack = new EventCallbackDelegate(Callback); //修改后 EnumWindows(myCallBack, 0); MgrAPIWrapper.SetEventCallback(myCallBack); MessageBoxAdapter.ShowDebug("SetEventCallback ok"); }
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); }
private void cmenuitemUnDeaf_Click(object sender, EventArgs e) { ListBoxItem item = lbConferenceMember.SelectedItem as ListBoxItem; if (item == null) { MessageBoxAdapter.ShowDebug("请确保选中要取消静音的号码!"); return; } TheMotherWin._ControlConferenceMember("undeaf", item.Value); }
private void btnManager_Disconnect_Click(object sender, EventArgs e) { bool ret = MgrAPIWrapper.Manager_Disconnect(); if (ret) { MessageBoxAdapter.ShowDebug("disconnect ok"); } else { MessageBoxAdapter.ShowDebug("disconnect error"); } }
private void btnManager_CloseMonitor_Click(object sender, EventArgs e) { bool ret = MgrAPIWrapper.Manager_CloseMonitor(MonitorId); if (ret) { MessageBoxAdapter.ShowDebug("CloseMonitor ok"); } else { MessageBoxAdapter.ShowDebug("CloseMonitor error"); } }
private void BindingPA() { string bindingPACode = txtBindingCode.Text.Trim(); if (bindingPACode.Substring(2, 6).Length < 6) { MessageBoxAdapter.ShowError("无效的PA码"); return; } SettingsVar.BindingPACode = bindingPACode; INIAdapter.WriteValue(Common.INI_SECTION_LOCAL, Common.INT_KEY_BINDING_PA_CODE, SettingsVar.BindingPACode, Common.INI_FILE_PATH); this.DialogResult = System.Windows.Forms.DialogResult.OK; }
public void SetCallTransfer() { if (CloseForCountdown) { //当前窗口和电话不对应 MessageBoxAdapter.ShowError("当前窗口马上将自动关闭,无法响应您的操作"); return; } if (InvokeTransfer != null) { InvokeTransfer(this, new EventArgs()); } }
private void btnOk_Click(object sender, EventArgs e) { if (txtUserName.Text.Trim() == "") { MessageBoxAdapter.ShowError("请输入用户名"); return; } if (txtPassword.Text.Trim() == "") { MessageBoxAdapter.ShowError("请输入密码"); return; } DoLogin(txtUserName.Text.Trim(), txtPassword.Text.Trim()); }
private void btnManager_OpenMonitor_Click(object sender, EventArgs e) { string dn = "DAHDI/1"; string ext = "714001"; int ret = MgrAPIWrapper.Manager_OpenMonitor(dn, ext); if (ret == 1) { MessageBoxAdapter.ShowDebug("OpenMonitor ok"); } else { MessageBoxAdapter.ShowDebug("OpenMonitor " + ret.ToString()); } }
private void frmMain_Load(object sender, EventArgs e) { authEndPoint = INIAdapter.ReadValue(Common.INI_SECTION_WEB, Common.INI_KEY_AUTH_END_POINT, Common.INI_FILE_PATH); smsEndPoint = INIAdapter.ReadValue(Common.INI_SECTION_WEB, Common.INI_KEY_SMS_END_POINT, Common.INI_FILE_PATH); ismgEndPoint = INIAdapter.ReadValue(Common.INI_SECTION_WEB, Common.INI_KEY_ISMG_END_POINT, Common.INI_FILE_PATH); lblMsg.Show(); _tickTimer = new System.Timers.Timer(1 * 200); _tickTimer.Elapsed += new System.Timers.ElapsedEventHandler(delegate(object source, System.Timers.ElapsedEventArgs ee) { BeginInvoke(new Action(() => { if (lblMsg.Text.IndexOf(".") == -1) { lblMsg.Text += "."; } else if (lblMsg.Text.IndexOf(".") + 5 == lblMsg.Text.Length) { lblMsg.Text = lblMsg.Text.Substring(0, lblMsg.Text.Length - 5); } else { lblMsg.Text += "."; } })); }); //到达时间的时候执行事件; _tickTimer.AutoReset = true; //设置是执行一次(false)还是一直执行(true); _tickTimer.Enabled = true; //是否执行System.Timers.Timer.Elapsed事件; HttpAdapter.optionsAsyncTo(authEndPoint + "/", new { ApplicationId = "CS001" }.ToStringObjectDictionary(), (ret, res) => { if (ret != "ok") { MessageBoxAdapter.ShowError("无效的认证节点"); return; } this.UIInvoke(() => { lblMsg.Hide(); }); _tickTimer.Enabled = false; _tickTimer = null; InitSms(); }); }
private void frmCallService_FormClosing(object sender, FormClosingEventArgs e) { if (!_CurrentCallServiceFinished) { if (MessageBoxAdapter.ShowConfirm("本次服务还未处理完成,退出时将自动保存,确定要退出吗", Properties.Settings.Default.MessageBoxTitle) == DialogResult.OK) { //执行BS上的自动保存动作 string strCallServiceId = PageData.CallServiceId.ToString(); webBrowser.Document.InvokeScript("saveCallService", new object[] { strCallServiceId, "{}", "坐席工号<" + EnvironmentVar.UserCode + ">保存并退出服务" }); } else { e.Cancel = true; } } }
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("验证密码失败"); } }
private void btnManager_MakeCall_Click(object sender, EventArgs e) { string from = "5501"; string to = "18668001381"; string context = "DAHDI/1"; string calledIdName = "18668001381"; MgrResult ret = MgrAPIWrapper.Manager_MakeCall(from, to, context, calledIdName); if (ret == MgrResult.ok) { MessageBoxAdapter.ShowDebug("MakeCall ok"); } else { MessageBoxAdapter.ShowDebug("MakeCall " + ret.ToString()); } }
private void txtPassword_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == (char)Keys.Return) { if (txtUserName.Text.Trim() == "") { MessageBoxAdapter.ShowError("请输入用户名"); return; } if (txtPassword.Text.Trim() == "") { MessageBoxAdapter.ShowError("请输入密码"); return; } DoLogin(txtUserName.Text.Trim(), txtPassword.Text.Trim()); } }
/// -------------------------------------------------------------------------------- /// <summary> /// Resets the MessageBox adapter to the default adapter which will display a /// message box. /// </summary> /// -------------------------------------------------------------------------------- public static void Reset() { s_MsgBox = new MessageBoxAdapter(); }