private void mnu_NotifyTest_Click(object sender, EventArgs e) { try { FrmNotifyTest frm = new FrmNotifyTest(); if (frm.ShowDialog() == DialogResult.OK) { //调用E车通接口 ECardService.ArrayOfString cards = new ECardService.ArrayOfString(); cards.Add(frm.CardID); ECardService.NightParkingSoapClient client = new ECardService.NightParkingSoapClient(); ECardService.ResultMessage ret = client.ParkingLotFullSMS(frm.Msg, cards); if (ret.status) { MessageBox.Show("发送短信成功"); } else { MessageBox.Show("发送短信失败:" + ret.Message); } } } catch (Exception ex) { MessageBox.Show("短信测试调用出现异常:" + ex.Message); } }
private bool SyncToECar(ECardRecord record) { try { double limitationRemain = (double)(record.LimitationRemain == null ? 35 : record.LimitationRemain.Value); int sheetID = 0; if (!string.IsNullOrEmpty(record.SheetID)) { int.TryParse(record.SheetID, out sheetID); } ECardService.NightParkingSoapClient client = new ECardService.NightParkingSoapClient(); ECardService.ResultMessage ret = client.AddParkingHistory(record.CardID, sheetID, record.Carplate, record.EnterDt.Value, record.EventDt, limitationRemain, string.Empty, string.Empty, string.Empty); if (!ret.status) { ShowMessage("上传车辆出场记录失败,原因:" + ret.Message, Color.Red); Ralid.GeneralLibrary.LOG.FileLog.Log("一车通上传", ret.Message); } return(ret.status); } catch (Exception ex) { ShowMessage("上传车辆出场记录调用出现异常:" + ex.Message, Color.Red); } return(false); }
private void toolStripButton1_Click(object sender, EventArgs e) { try { //调用E车通接口 ECardService.NightParkingSoapClient client = new ECardService.NightParkingSoapClient(); string ret = client.HelloWorld(); MessageBox.Show("连通测试返回:" + ret); } catch (Exception ex) { MessageBox.Show("连通测试调用出现异常:" + ex.Message); } }
private bool NotifyECar(string msg, List <CardInfo> cards) { try { ECardService.ArrayOfString strs = new ECardService.ArrayOfString(); //strs.AddRange(cards.Select(item => item.CardID)); strs.Add("0121010274"); strs.Add("0121010274"); ECardService.NightParkingSoapClient client = new ECardService.NightParkingSoapClient(); ECardService.ResultMessage ret = client.ParkingLotFullSMS(msg, strs); if (!ret.status) { ShowMessage("发送车位满位通知失败,原因:" + ret.Message, Color.Red); Ralid.GeneralLibrary.LOG.FileLog.Log("一车通上传", ret.Message); } return(ret.status); } catch (Exception ex) { ShowMessage("发送车位满位通知调用出现异常:" + ex.Message, Color.Red); } return(false); }