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 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); }