| | |
| | | using NPOI.HSSF.UserModel; |
| | | using NPOI.SS.UserModel; |
| | | using NPOI.SS.Util; |
| | | using PBS.Model; |
| | | using PBS.Vmo; |
| | | using System.IO; |
| | | using Yw; |
| | |
| | | public event EventHandler<string> SendData; |
| | | private void SendText(string content) |
| | | { |
| | | SendData?.Invoke(null, content); |
| | | if (SendData != null) |
| | | { |
| | | SendData?.Invoke(null, content); |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (IBoxHelper.Ping()) |
| | | { |
| | | var smsg = content.Split(new string[] { IBoxHelper.paramCode, IBoxHelper.startCode }, StringSplitOptions.RemoveEmptyEntries); |
| | | if (smsg.Length < 2) |
| | | { |
| | | return; |
| | | } |
| | | switch (smsg[0].Trim()) |
| | | { |
| | | case IBoxHelper.getrulesCode: |
| | | { |
| | | var order = IBoxHelper.HttpGet(content); |
| | | var result = IBoxHelper.GetContent(order); |
| | | if (!string.IsNullOrEmpty(result)) |
| | | { |
| | | var model = JsonHelper.Json2Object<List<StationMonitorListGroupMobileDto>>(result); |
| | | BindGrid(model, false); |
| | | } |
| | | break; |
| | | } |
| | | case IBoxHelper.saveparamsCode: |
| | | case IBoxHelper.addMonitorgroupCode: |
| | | case IBoxHelper.addsignalCode: |
| | | { |
| | | IBoxHelper.HttpPost(content); |
| | | break; |
| | | |
| | | } |
| | | default: |
| | | IBoxHelper.HttpGet(content); |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MessageBoxHelper.ShowWarning("网络连接失败,请检查网络"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void EboxFormRule_Load(object sender, EventArgs e) |