public void Recv(string res) { try { DetrResult dr = new DetrResult(res); if ((res.ToUpper().IndexOf("OPEN") > 0 || res.ToUpper().IndexOf("SUSPENDED") > 0)) { if (res.Split(new string[] { "OPEN" }, StringSplitOptions.None).Length > res.Split(new string[] { "REFUNDED" }, StringSplitOptions.None).Length * 2) { File.AppendAllText(filenm2, m_ls[0] + "\r\n", Encoding.Default); } //File.AppendAllText(filenm2, res + "\r\n", Encoding.Default); } } catch { File.AppendAllText(filenm2, m_ls[0] + "检查时发生错误!\r\n", Encoding.Default); } m_ls.RemoveAt(0); File.WriteAllLines(filenm, m_ls.ToArray(), Encoding.Default); DetrOneTicket(); }
/// <summary> /// 处理detr返回结果给打印对话框(行程单,保险,等) /// </summary> private void HandleDetr() { try { detrResult = new DetrResult(dataHandler.COMMANDRESULT); try { receipt.SetControlsByDetrResult(detrResult); } catch { } try { Printer.Insurance.Instance.SetControlsByDetrResult(detrResult); } catch { } } catch { } }