//手机号:15910606127 //取票码:865672 //554042 private void btnGetTicket_Click(object sender, EventArgs e) { string msgType = "30"; //string str = this.txtMobile.Text.Trim() + "\t" + this.txtValidCode.Text.Trim() + "\t" + this.txtFlag.Text.Trim() + "\n"; string str = "1,2,3,4,5,6,7\r1,2,3\r" + this.txtMobile.Text.Trim() + "\t" + this.txtValidCode.Text.Trim() + "\t" + txtFlag.Text.Trim() + "\n"; //str = msgType + str; //helper.Send(str); //HipiaoTcpHelper.GetTicket(str); // int port = 2908; //string host = "119.10.114.212"; int port = Convert.ToInt32(this.txtPort.Text.Trim()); string host = this.txtIp.Text.Trim(); HipiaoTcpHelper.GetTicket(host, port, HiPiaoProtocol.PackSend(msgType, str), this.txtRecieve); }
private void timer1_Tick(object sender, EventArgs e) { timer1.Stop(); try { SystemConfig config = FT.Commons.Cache.StaticCacheManager.GetConfig <SystemConfig>(); ArrayList tickets = new ArrayList(); if (config.IsDingXin) { tickets = HipiaoTcpHelper.GetDingxinTicket("1", "13269402753", "694540"); // tickets = HipiaoTcpHelper.GetDingxinTicket(config.CinemaId, mobile, validCode); } else { //this.ChangeHint("该影票已出过票!"); //this.ChangeHint("网络故障,请向影院工作人员垂询!", "或拨打400-601-556"); // GlobalTools.ChangePanel(this.FindForm(), new MessagePanelFirst("该影票已出过票!")); // GlobalTools.ChangePanel(this.FindForm(), new InputErrorPanel()); // GlobalTools.ChangePanel(this.FindForm(), new MessagePanelFirst("网络故障,请向影院工作人员垂询!", "或拨打400-601-556")); // return; string msgType = "30"; //string str = this.txtMobile.Text.Trim() + "\t" + this.txtValidCode.Text.Trim() + "\t" + this.txtFlag.Text.Trim() + "\n"; string str = "1,2,3,4,5,6,7\r1,2,3\r" + mobile + "\t" + validCode + "\t0\n"; //str = msgType + str; //helper.Send(str); //HipiaoTcpHelper.GetTicket(str); //SystemConfig config = FT.Commons.Cache.StaticCacheManager.GetConfig<SystemConfig>(); tickets = HipiaoTcpHelper.GetTicket(config.CinemaServerIp, config.CinemaServerPort, HiPiaoProtocol.PackSend(msgType, str)); //TicketPrintObject ticket = HiPiaoInterface.HiPiaoOperatorFactory.GetMockHiPiaoOperator().GetTicket(mobile, valid); // GlobalHardwareTools.ticket = ticket; } if (tickets != null && tickets.Count > 0 && ((TicketPrintObject)tickets[0]).PrintTime != null) { if (((TicketPrintObject)tickets[0]).IsPrinted == false) { //this.pictureBox1.Image = Properties.Resources.Print_Wait_Print; //this.un // System.Threading.Thread.Sleep(2000); // this.pictureBox1.Image = Properties.Resources.Print_Wait_Success; // System.Threading.Thread.Sleep(2000); // this.FindForm().Close(); GlobalTools.ChangePanel(this.FindForm(), new WaitPrintPanel(tickets)); } else { //retCode = 1; //this.FindForm().Close(); this.ChangeHint("该影票已出过票!"); // GlobalTools.ChangePanel(this.FindForm(), new MessagePanelFirst("该影票已出过票!")); } } else { // retCode = 2; // this.FindForm().Close(); GlobalTools.ChangePanel(this.FindForm(), new InputErrorPanel()); // GlobalTools.ReturnTicketPrint(); } } catch (Exception ex) { Console.WriteLine(ex); //retCode = 3; // this.FindForm().Close(); // System.Threading.Thread.Sleep(1000); // this.ChangePanel(new MessagePanelFirst("网络故障,请向影院工作人员垂询!", "或拨打400-601-556")); // GlobalTools.ChangePanel(this.FindForm(), new MessagePanelFirst("网络故障,请向影院工作人员垂询!", "或拨打400-601-556")); this.ChangeHint("网络故障,请向影院工作人员垂询!", "或拨打400-601-556"); } }
public static bool PrintTickets(string mobile, string validCode) { string msgType = "30"; //string str = this.txtMobile.Text.Trim() + "\t" + this.txtValidCode.Text.Trim() + "\t" + this.txtFlag.Text.Trim() + "\n"; string str = "1,2,3,4,5,6,7\r1,2,3\r" + mobile + "\t" + validCode + "\t0\n"; //str = msgType + str; //helper.Send(str); //HipiaoTcpHelper.GetTicket(str); SystemConfig config = FT.Commons.Cache.StaticCacheManager.GetConfig <SystemConfig>(); return(PrintTickets(HipiaoTcpHelper.GetTicket(config.CinemaServerIp, config.CinemaServerPort, HiPiaoProtocol.PackSend(msgType, str)))); }