private void Page_Loaded(object sender, RoutedEventArgs e) { // this.parent.SelfHelpInfo.PayType = ""; this.parent.mSelfHelpClass.PayType = "";//支付方式 自助售票类 //this.ticketDate.Text = this.parent.SelfHelpInfo.SaleTime; // this.ticketDate.Text = this.parent.mSelfHelpClass.SaleTime;//销售时间 自助售票类 // this.ticketType.Text = ConfigHelper.GetConfigValue("ticket", "t" + this.parent.SelfHelpInfo.TicketType); if (this.parent.mSelfHelpClass.BoxNumber == "A") { this.ticketType.Text = T_SellTicketRecord.GetTicketTypeName(M_Configuration.TicketTypeID_1);//票种 自助售票类\ } else if (this.parent.mSelfHelpClass.BoxNumber == "B") { this.ticketType.Text = T_SellTicketRecord.GetTicketTypeName(M_Configuration.TicketTypeID_2);//票种 自助售票类\ } // this.ticketCount.Text = this.parent.SelfHelpInfo.TicketCount.ToString(); this.ticketCount.Text = this.parent.mSelfHelpClass.TicketCount.ToString(); //票数 自助售票类 //this.ticketPriceTotal.Text = this.parent.SelfHelpInfo.TicketPriceTotal.ToString(); this.ticketPriceTotal.Text = this.parent.mSelfHelpClass.RealSum.ToString(); //销售金额 自助售票类 //this.ss.SelectVoiceByHints(VoiceGender.Female); // string configValue = ConfigHelper.GetConfigValue("speechqp", "paytype"); // this.ss.SpeakAsync(configValue); }
private void Page_Loaded(object sender, RoutedEventArgs e) { //this.parent.SelfHelpInfo.PayType = "alipay"; //this.parent.SelfHelpInfo.PayodNo = string.Empty; //this.parent.SelfHelpInfo.PayRefNo = string.Empty; //this.parent.SelfHelpInfo.PayTxnId = string.Empty; //this.parent.SelfHelpInfo.PaySuccess = false; //this.parent.SelfHelpInfo.PayReturnInfo = string.Empty; // this.ticketDate.Text = this.parent.SelfHelpInfo.SaleTime; //this.ticketCount.Text = this.parent.SelfHelpInfo.TicketCount.ToString(); //this.ticketType.Text = ConfigHelper.GetConfigValue("ticket", "t" + this.parent.SelfHelpInfo.TicketType); //this.ticketPriceTotal.Text = this.parent.SelfHelpInfo.TicketPriceTotal.ToString(); //this.ticketTotal.Text = this.parent.SelfHelpInfo.TicketPriceTotal.ToString(); //********************************支付部分***************************** this.parent.mSelfHelpClass.OperType = "0"; //取票还是购票 0表示购票 1表示取票 自助售票类 this.parent.mSelfHelpClass.PayType = "04"; //支付方式 自助售票类 01-现金,02-POS付款,03-微信,04-支付宝,05-代理 this.parent.mSelfHelpClass.PayStat = "1"; //支付状态(1-待支付 2-已支付 3-支付失败) this.parent.mSelfHelpClass.PayTypeID = T_SellTicketRecord.CreateTableUID(M_Configuration.CLIENTID, T_SellTicketRecord.LocalPayType_Prefix, 1); //支付单号 自助售票类 this.parent.mSelfHelpClass.PayID = string.Empty; //第三方支付单号 自助售票类 this.parent.mSelfHelpClass.PaySuccess = false; //是否支付成功 自助售票类 // this.ticketDate.Text = this.parent.mSelfHelpClass.SaleTime;//销售时间 自助售票类 this.ticketCount.Text = this.parent.mSelfHelpClass.TicketCount.ToString(); //票数 自助售票类 this.ticketType.Text = T_SellTicketRecord.GetTicketTypeName(this.parent.mSelfHelpClass.TicketTypeID); //票种 自助售票类 this.ticketPriceTotal.Text = this.parent.mSelfHelpClass.RealSum.ToString(); //销售金额 自助售票类 // this.ticketTotal.Text = this.parent.mSelfHelpClass.RealSum.ToString();//销售金额 自助售票类 //********************************支付部分***************************** //********************支付部分*********************** T_SellTicketRecord.slpaytype.OrderId = this.parent.mSelfHelpClass.OrderID; //销售单号 T_SellTicketRecord.slpaytype.PayTypeId = this.parent.mSelfHelpClass.PayTypeID; //支付单号 T_SellTicketRecord.slpaytype.PayType = this.parent.mSelfHelpClass.PayType; //支付方式 T_SellTicketRecord.slpaytype.Amt = this.parent.mSelfHelpClass.RealSum; //支付金额 T_SellTicketRecord.slpaytype.VersionNo = T_Date.ConvertDataTimeToLong(DateTime.Now); //版本号 //***************获取支付方式***************** //*******************写入数据*************************** this.parent.mSelfHelpClass.PayTypeID = T_SellTicketRecord.CreateTableUID(M_Configuration.CLIENTID, T_SellTicketRecord.LocalPayType_Prefix, 1); //支付单号 自助售票类 this.parent.mSelfHelpClass.OrderID = T_SellTicketRecord.CreateTableUID(M_Configuration.CLIENTID, T_SellTicketRecord.LocalTicket_Prefix_ZG, 1); //销售单号 this.parent.mSelfHelpClass.PayStat = "2"; //支付状态(1-待支付 2-已支付 3-支付失败) if (!T_SellTicketRecord.Insert_GP_Data(this.parent.mSelfHelpClass)) { _log.Error("支付宝购票数据写入失败!"); return; } //*******************写入数据*************************** this.odNo = ConfigHelper.GetConfigValue("pay", "odNoHead").PadLeft(2, '0') + ConfigHelper.GetConfigValue("window", "deviceNo").PadLeft(2, '0') + ConfigHelper.GetConfigValue("window", "busNo").PadLeft(2, '0') + DateTime.Now.ToString("yyMMddHHmmss"); //this.ss.SelectVoiceByHints(VoiceGender.Female); //this.ss.SpeakAsync("使用支付宝扫一扫,扫描右侧二维码"); this.counttimer = new DispatcherTimer(); this.counttimer.Interval = new TimeSpan(0, 0, 0, 1, 0); //10秒支付时间 this.counttimer.Tick += new EventHandler(this.timer_Tick); this.counttimer.Start(); this.inputBox.Focus(); //委托用 this.timer_test = new DispatcherTimer(); this.timer_test.Interval = new TimeSpan(0, 0, 0, 1, 0); this.timer_test.Tick += new EventHandler(this.Timer_test); this.timer_test.Start(); this.isre = false; this.istest = false; }
private void Window_Loaded(object sender, RoutedEventArgs e) { try { WinSleepCtr.PreventScreenSave(); WinSleepCtr.PreventSleep(true); //*******************端口连接部分 T_ReadConfig.ReadConfig(); //读取配置文件 T_ReadConfig.GetPIN(); //获取PIN码 AUTHORIZATION auth = new AUTHORIZATION(); auth.ClientId = M_Configuration.CLIENTID; //终端号 auth.Token = M_Configuration.TOKEN; //ConfigurationManager.AppSettings["Token"].ToString();//授权码 Client = new T_RpcClient(auth, M_Configuration.HOST, M_Configuration.PORT, M_Configuration.TIMEOUT); //StateClient = new T_RpcClient(auth, M_Configuration.HOST, M_Configuration.PORT, M_Configuration.TIMEOUT); // HeartClient = new T_RpcClient(auth, M_Configuration.HOST, M_Configuration.PORT, M_Configuration.TIMEOUT);//心跳 //票种名称 M_Configuration.RunState = 0;//自助售票运行状态 0表示正常 M_Configuration.TicketID_AName = T_SellTicketRecord.GetTicketTypeName(M_Configuration.TicketTypeID_1); M_Configuration.TicketID_BName = T_SellTicketRecord.GetTicketTypeName(M_Configuration.TicketTypeID_2); #region//暂时不用 ////获取票种信息 //try //{ // M_TicketTypeList.listTicketType = Client.TicketTypeSyncRpc(T_Date.ConvertDataTimeToLong(DateTime.Now)); //} //catch (Exception ex) //{ // _log.Error(typeof(MainWindow), ex); //} ////获取售售期信息 //try //{ // M_PeriodList.listPeriod = Client.SalePeriodSyncRpc(T_Date.ConvertDataTimeToLong(DateTime.Now)); //} //catch (Exception ex) //{ // _log.Error(typeof(MainWindow), ex); //} #endregion ////启动数据同步线程 _DataSyncThread = new Thread(new ThreadStart(_theadDeal.DataSyncThread)); _DataSyncThread.Name = "DataSyncThread"; _DataSyncThread.IsBackground = true; _DataSyncThread.Start(); _DataSyncThread.Priority = ThreadPriority.BelowNormal; Thread.Sleep(10); if (_DataSyncThread.IsAlive) { _log.Info("数据同步工作线程启动成功。"); } ////*******************端口连接部分 //强制回收线程 TGCThread = new T_GCThread(); GCThread = new Thread(new ThreadStart(TGCThread.DoWork)); GCThread.IsBackground = true; GCThread.Start(); if (GCThread.IsAlive) { _log.Error("强制回收线程启动成功!"); } string strSAM = M_Configuration.Samreadername; string strRFID = M_Configuration.RfidReadername; string strPIN = M_Configuration.Pin; try { rfidReaderTest = TicketHandlerAdapter.getRfidTicketHandler(Convert.ToInt32(M_Configuration.CLIENTID), strRFID, strSAM, Encoding.ASCII.GetBytes(strPIN)); } catch { // MessageBox.Show("初始化失败,请确认读卡器选择正确!"); } this.totaltimeout = int.Parse(ConfigHelper.GetConfigValue("window", "totaltimeout"));//操作最长时间 this.InitControlSize(); base.WindowState = WindowState.Maximized; base.WindowStyle = WindowStyle.None; base.ResizeMode = ResizeMode.NoResize; base.Left = 0.0; base.Top = 0.0; this.notice = new NoticePage(ConfigHelper.GetConfigValue("window", "notice"), double.Parse(ConfigHelper.GetConfigValue("window", "noticefontsize"))); this.topFrame.Content = this.notice; //this.videopage = new VideoPage(this); //this.topFrame.Content = this.videopage; this.imagepage = new ImageShowPage(this); this.middleFrame.Content = this.imagepage; pageTest = new FirstPage(this); this.operationpage = pageTest;//new FirstPage(this); this.mainFrame.Content = this.operationpage; //bool flag = SystemInfo.GetAllNetInfo() != null; //if (flag) //{ // this.MacStr = SystemInfo.GetAllNetInfo()[0].PhysAddr; //} this.countdowntimer = new DispatcherTimer(); this.countdowntimer.Interval = new TimeSpan(0, 0, 0, 1, 0); this.countdowntimer.Tick += new EventHandler(this.timer_Tick); this.countdowntimer.Start(); } catch (Exception ex) { _log.Error("服务器连接失败!"); _log.Error(typeof(MainWindow), ex); MessageBox.Show("服务器连接失败!", T_SellTicketRecord.str_Apption, MessageBoxButton.OK, MessageBoxImage.Information); base.Close(); } }
//internal StackPanel dockfull; //internal StackPanel TicketImg; //internal TextBlock tb_selectdate; //internal TextBlock tb_selecttype; //internal Button btn_J; //internal TextBlock tb_Count; //internal Button btn_Z; //internal TextBlock tb_ShowTotal; //internal Button btn_GQ; //internal Button btn_SY; //internal Button btn_FH; public GPPage3(MainWindow parentWindow) { this.parent = parentWindow; this.InitializeComponent(); //this.tb_selectdate.Text = this.parent.SelfHelpInfo.SaleTime; // this.tb_selectdate.Text = this.parent.mSelfHelpClass.SaleTime;//自助售票类 销售时间 即当时间 ImageBrush imageBrush = new ImageBrush(); //imageBrush.ImageSource = new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + "\\pic\\bn" + this.parent.SelfHelpInfo.TicketType + ".png")); imageBrush.Stretch = Stretch.Fill; this.TicketImg.Background = imageBrush; //this.tb_selectdate.Text = this.parent.SelfHelpInfo.SaleTime; // this.tb_selectdate.Text = this.parent.mSelfHelpClass.SaleTime;//自助售票类 //this.tb_selecttype.Text = ConfigHelper.GetConfigValue("ticket", "t" + this.parent.SelfHelpInfo.TicketType); //*****获取票种名称 this.tb_selecttype.Text = T_SellTicketRecord.GetTicketTypeName(this.parent.mSelfHelpClass.TicketTypeID); if ((this.tb_selecttype.Text.Length > 3) && (this.tb_selecttype.Text.Length < 6)) { this.tb_selecttype.FontSize = 50; } else if (this.tb_selecttype.Text.Length > 6) { this.tb_selecttype.FontSize = 40; } else if (this.tb_selecttype.Text.Length < 3) { this.tb_selecttype.FontSize = 60; } //this.tb_ShowTotal.Text = this.parent.SelfHelpInfo.TicketPriceTotal.ToString(); this.tb_ShowTotal.Text = this.parent.mSelfHelpClass.RealSum.ToString();//自助售票类 //*************显示票种图片 string str = ""; if (this.parent.mSelfHelpClass.TicketTypeID == M_Configuration.TicketTypeID_1) { str = AppDomain.CurrentDomain.BaseDirectory + "\\Ticket\\" + M_Configuration.TicketTypeID_1 + ".png"; if (System.IO.File.Exists(str)) { // BitmapImage imagetemp = new BitmapImage(new Uri(str, UriKind.Absolute)); this.img_show.Source = null; this.img_show.Source = this.parent.GetImage(str); //imagetemp; } else { str = AppDomain.CurrentDomain.BaseDirectory + "\\Ticket\\default.png"; // BitmapImage imagetemp = new BitmapImage(new Uri(str, UriKind.Absolute)); this.img_show.Source = null; this.img_show.Source = this.parent.GetImage(str); //imagetemp; } this.txt_show.Text = M_Configuration.boxA_info; //票箱说明 } else if (this.parent.mSelfHelpClass.TicketTypeID == M_Configuration.TicketTypeID_2) { str = AppDomain.CurrentDomain.BaseDirectory + "\\Ticket\\" + M_Configuration.TicketTypeID_2 + ".png"; if (System.IO.File.Exists(str)) { // BitmapImage imagetemp = new BitmapImage(new Uri(str, UriKind.Absolute)); this.img_show.Source = null; this.img_show.Source = this.parent.GetImage(str); // imagetemp; } else { str = AppDomain.CurrentDomain.BaseDirectory + "\\Ticket\\default.png"; //BitmapImage imagetemp = new BitmapImage(new Uri(str, UriKind.Absolute)); this.img_show.Source = null; this.img_show.Source = this.parent.GetImage(str); //imagetemp; } this.txt_show.Text = M_Configuration.boxB_info; //票箱说明 } }
private void Page_Loaded(object sender, RoutedEventArgs e) { //this.parent.SelfHelpInfo.PayType = "weixin"; //this.parent.SelfHelpInfo.PayodNo = string.Empty; //this.parent.SelfHelpInfo.PayRefNo = string.Empty; //this.parent.SelfHelpInfo.PayTxnId = string.Empty; //this.parent.SelfHelpInfo.PaySuccess = false; //this.parent.SelfHelpInfo.PayReturnInfo = string.Empty; //this.ticketDate.Text = this.parent.SelfHelpInfo.SaleTime; //this.ticketCount.Text = this.parent.SelfHelpInfo.TicketCount.ToString(); //this.ticketType.Text = ConfigHelper.GetConfigValue("ticket", "t" + this.parent.SelfHelpInfo.TicketType); //this.ticketPriceTotal.Text = this.parent.SelfHelpInfo.TicketPriceTotal.ToString(); //this.ticketTotal.Text = this.parent.SelfHelpInfo.TicketPriceTotal.ToString();//wjl //**********************支付部分********************* this.parent.mSelfHelpClass.OperType = "0"; //取票还是购票 0表示购票 1表示取票 自助售票类 this.parent.mSelfHelpClass.PayType = "03"; //支付方式 自助售票类 01-现金,02-POS付款,03-微信,04-支付宝,05-代理 this.parent.mSelfHelpClass.PayStat = "1"; //支付状态(1-待支付 2-已支付 3-支付失败) this.parent.mSelfHelpClass.PayTypeID = ""; //支付单号暂不生成 T_SellTicketRecord.CreateTableUID(M_Configuration.CLIENTID, T_SellTicketRecord.LocalPayType_Prefix, 1);//支付单号 自助售票类 this.parent.mSelfHelpClass.PayID = string.Empty; //第三方支付单号 自助售票类 this.parent.mSelfHelpClass.PaySuccess = false; //是否支付成功 自助售票类 // this.ticketDate.Text = this.parent.mSelfHelpClass.SaleTime;//销售时间 自助售票类 this.ticketCount.Text = this.parent.mSelfHelpClass.TicketCount.ToString(); //票数 自助售票类 this.ticketType.Text = T_SellTicketRecord.GetTicketTypeName(this.parent.mSelfHelpClass.TicketTypeID); //票种 自助售票类 this.ticketPriceTotal.Text = this.parent.mSelfHelpClass.RealSum.ToString(); //销售金额 自助售票类 // this.ticketTotal.Text = this.parent.mSelfHelpClass.RealSum.ToString();//销售金额 自助售票类 //********************支付部分*********************** T_SellTicketRecord.slpaytype.OrderId = this.parent.mSelfHelpClass.OrderID; //销售单号 T_SellTicketRecord.slpaytype.PayTypeId = this.parent.mSelfHelpClass.PayTypeID; //支付单号 T_SellTicketRecord.slpaytype.PayType = this.parent.mSelfHelpClass.PayType; //支付方式 T_SellTicketRecord.slpaytype.Amt = this.parent.mSelfHelpClass.RealSum; //支付金额 T_SellTicketRecord.slpaytype.VersionNo = T_Date.ConvertDataTimeToLong(DateTime.Now); //版本号 //***************获取支付方式***************** //*******************写入数据*************************** this.parent.mSelfHelpClass.PayTypeID = T_SellTicketRecord.CreateTableUID(M_Configuration.CLIENTID, T_SellTicketRecord.LocalPayType_Prefix, 1); //支付单号 自助售票类 this.parent.mSelfHelpClass.OrderID = T_SellTicketRecord.CreateTableUID(M_Configuration.CLIENTID, T_SellTicketRecord.LocalTicket_Prefix_ZG, 1); //销售单号 this.parent.mSelfHelpClass.PayStat = "2"; //支付状态(1-待支付 2-已支付 3-支付失败) if (!T_SellTicketRecord.Insert_GP_Data(this.parent.mSelfHelpClass)) { _log.Error("微信支付数据写入失败!"); return; } //*******************写入数据*************************** //this.ss.SelectVoiceByHints(VoiceGender.Female); //this.ss.SpeakAsync("使用微信扫一扫,扫描右侧二维码"); // this.parent.SelfHelpInfo.PaySuccess = false; this.counttimer = new DispatcherTimer(); this.counttimer.Interval = new TimeSpan(0, 0, 0, 1, 0); this.counttimer.Tick += new EventHandler(this.timer_Tick); this.counttimer.Start(); this.inputBox.Focus(); this.timer_test = new DispatcherTimer(); this.timer_test.Interval = new TimeSpan(0, 0, 0, 1, 0); this.timer_test.Tick += new EventHandler(this.test); this.timer_test.Start(); this.isre = false; this.istest = false; //string str = AppDomain.CurrentDomain.BaseDirectory + "flash" + "\\f3.swf"; //this.web.Navigate(str); }
private void timer_Tick(object sender, EventArgs e) { //this.counttimer.Stop(); //bool flag = !this.locktag; //if (flag) //{ // this.locktag = true; // while (this.cardCount > 0) // { // string empty = "票号?";// string.Empty; // bool flag2 = false;//!this.api.ReadCard(out empty);//wjl // if (flag2) // { // this.isError = true; // break; // } // bool flag3 = !this.api.OutputCard();//wjl // if (flag3) // { // this.isError = true; // break; // } // this.cardCount--; // this.parent.SelfHelpInfo.TicketNumberList.Add(empty); // System.Threading.Thread.Sleep(1000); // } //} //bool flag4 = false;// this.cardCount == 0;//this.cardCount > 0 && this.isError; if (isError) { StringBuilder stringBuilder = new StringBuilder(); //stringBuilder.AppendLine("景区票种:" + ConfigHelper.GetConfigValue("ticket", "t" + this.parent.SelfHelpInfo.TicketType)); //stringBuilder.AppendLine("购买数量:" + this.parent.SelfHelpInfo.TicketCount); //stringBuilder.AppendLine("已付金额:" + this.parent.SelfHelpInfo.TicketPriceTotal); //stringBuilder.AppendLine("已出票数:" + (this.parent.SelfHelpInfo.TicketCount - this.cardCount).ToString()); //stringBuilder.AppendLine("购买日期:" + DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss")); //stringBuilder.AppendLine(""); //stringBuilder.AppendLine("请联系工作人员取票!"); stringBuilder.AppendLine("景区票种:" + T_SellTicketRecord.GetTicketTypeName(this.parent.mSelfHelpClass.TicketTypeID)); stringBuilder.AppendLine("购买数量:" + this.parent.mSelfHelpClass.TicketCount); stringBuilder.AppendLine("已付金额:" + this.parent.mSelfHelpClass.RealSum); stringBuilder.AppendLine("已出票数:" + (this.parent.mSelfHelpClass.TicketCount - this.cardCount).ToString()); stringBuilder.AppendLine("购买日期:" + DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss")); stringBuilder.AppendLine(""); stringBuilder.AppendLine("请联系工作人员取票!"); this.parent.WarmOperation(stringBuilder.ToString(), "error", false); //LogHelper.WriteLog(new LogHelper //{ // Message = "已付款,但是无法出票!", // StackTrace = stringBuilder.ToString() //}); } else { if (this.cardCount == 0)// wjl add { //**************改为出一张票就上传一次的 //this.web.Source = new Uri(AppDomain.CurrentDomain.BaseDirectory + "flash\\f7.swf"); // this.ss.SelectVoiceByHints(VoiceGender.Female); // this.ss.SpeakAsync("请取票!"); this.Dispatcher.BeginInvoke((Action) delegate() { if (this.parent.ticketbox_isErr != 1)//票种放反 { this.txt_show.Text = "购票信息-出票完毕,请取票!!"; } isre = true; }); if (isre) { System.Threading.Thread.Sleep(3000); this.cardCount = -1; this.parent.EndOperation(); isre = false; } } else if (this.cardCount == -99999) { this.Dispatcher.BeginInvoke((Action) delegate() { this.txt_show.Foreground = System.Windows.Media.Brushes.Red; this.txt_show.Text = "购票信息-刮票失败!请到人工窗口取票!"; isre = true; }); if (isre) { // System.Threading.Thread.Sleep(300); this.cardCount = -1; // this.parent.EndOperation(); if (this.parent.ticketbox_isErr == 0) { this.parent.Err_Info = "出票失败!请到人工售票窗口取票。"; this.parent.Operation("error"); } else if (this.parent.ticketbox_isErr == 1) //票种放反的 { this.parent.Err_Info = "出票失败!请到人工售票窗口取票。"; //"所购票种与实际出票种不符!\r\n请到人工售票窗口取票!"; this.parent.Operation("error"); } else if (this.parent.ticketbox_isErr == 100) //上传失败 { this.parent.Err_Info = "出票失败!请到人工售票窗口取票。"; // "系统提示:\r\n数据上传失败!\r\n请到人工售票窗口取票!"; this.parent.Operation("error"); } isre = false; } } //LogHelper.WriteLog(this.parent.SelfHelpInfo.ToString(), AppDomain.CurrentDomain.BaseDirectory + "pay" + DateTime.Now.ToString("yyyyMMdd") + ".log"); } }