private void InitMovieInfo() { if (lists != null) { SystemConfig config = FT.Commons.Cache.StaticCacheManager.GetConfig <SystemConfig>(); this.lbCinema.Text = string.Format(this.lbCinema.Text, config.Cinema); TicketPrintObject ticket = lists[0]; string movieName = ticket.MovieName; if (movieName.Length > 9) { movieName = movieName.Substring(0, 9) + "..."; //this.lbMovieName.Location = new Point(this.lbMovieName.Location.X, this.lbMovieName.Location.Y + this.lbMovieName.Height + 2); } else { // movieName = movieName; } this.lbMovieName.Text = string.Format(this.lbMovieName.Text, ticket.MovieName, moviePlan.Type.Length == 0?"":"(" + moviePlan.Type + ")"); DateTime playDate = Convert.ToDateTime(ticket.PlayDate); this.lbDate.Text = string.Format(this.lbDate.Text, System.DateTime.Now.Year.ToString() + "-" + playDate.ToString("MM-dd"), ticket.PlayTime); //this.lbRoom.Location = new Point(this.lbTimeHint.Location.X + this.lbTimeHint.Width, this.lbTimeHint.Location.Y); int num = 4; string seat = string.Empty; for (int i = 0; i < lists.Count; i++) { if (i != 0 && i % num == 0) { // seat += "\n座位:" seat += "\n "; } if (i == 0) { seat += lists[i].Seat; } else { seat += "、" + lists[i].Seat; } } int totalPrice = (ticket.Price * this.lists.Count); int ye = Convert.ToInt32(GlobalTools.GetLoginUser().Balance) - 0; // WinFormHelper.LocationAfter(this.lbPrice, this.lbTicketPriceHint); this.lbNum.Text = string.Format(this.lbNum.Text, this.lists.Count.ToString()); // WinFormHelper.LocationAfter(this.lbTicketPriceHint, this.lbTicketCount); //WinFormHelper.LocationAfter(this.lbTicketCount, this.lbTicketCountHint); this.lbRoom.Text = string.Format(this.lbRoom.Text, ticket.RoomName, seat); this.lbAllFee.Text = string.Format(this.lbAllFee.Text, totalPrice.ToString()); this.lbAccountMoney.Text = string.Format(this.lbAccountMoney.Text, ye); FT.Commons.Tools.WinFormHelper.VerLocationAfter(this.lbRoom, this.lbAllFee, 14); FT.Commons.Tools.WinFormHelper.VerLocationAfter(this.lbAllFee, this.lbAccountMoney, 14); // WinFormHelper.LocationAfter(this.lbTicketTotalPrice, this.lbTicketTotalPriceHint); } }
// public public static void PrintTickets(TicketPrintObject ticket) { if (ticket != null) { // MyOpaqueLayerTools.ShowOpaqueLayer(this.panelHeader, 60, true); GlobalHardwareTools.OpenHotPrinter(); GlobalHardwareTools.PrintTicket(ticket); GlobalHardwareTools.CloseHotPrinter(); } }
public static void PrintTicket(TicketPrintObject ticketTmp) { SystemConfig config = FT.Commons.Cache.StaticCacheManager.GetConfig <SystemConfig>(); if (config.PrinterType == "Windows") { PrintWindowsTemplate(ticketTmp, "TicketTemplate-Windows.txt"); } else { PrintTemplate(ticketTmp, "TicketTemplate.txt"); } }
private void InitMovieInfo() { if (lists != null) { TicketPrintObject ticket = lists[0]; this.picAdImage.Image = movieInfo.AdImage; //ticket.MovieName = "假如真的是爱情有天意的话"; if (ticket.MovieName.Length > 9) { this.lbMovieName.Text = ticket.MovieName.Substring(0, 9) + "\n" + ticket.MovieName.Substring(9); this.lbMovieInfo.Location = new Point(this.lbMovieName.Location.X, this.lbMovieName.Location.Y + this.lbMovieName.Height + 2); } else { this.lbMovieName.Text = ticket.MovieName; } this.lbMovieInfo.Text = string.Format(this.lbMovieInfo.Text, moviePlan.Type, moviePlan.Language, movieInfo.TotalMinutes); DateTime playDate = Convert.ToDateTime(ticket.PlayDate); this.lbDate.Text = playDate.ToString("MM月dd日") + " " + DateTimeHelper.GetChineseXq(playDate); WinFormHelper.LocationAfter(this.lbDate, this.lbDateHint); this.lbTime.Text = ticket.PlayTime; WinFormHelper.LocationAfter(this.lbDateHint, this.lbTime); WinFormHelper.LocationAfter(this.lbTime, this.lbTimeHint); this.lbRoom.Text = ticket.RoomName; WinFormHelper.LocationAfter(this.lbTimeHint, this.lbRoom); //this.lbRoom.Location = new Point(this.lbTimeHint.Location.X + this.lbTimeHint.Width, this.lbTimeHint.Location.Y); int num = 6; string seat = string.Empty; for (int i = 0; i < lists.Count; i++) { if (i != 0 && i % num == 0) { // seat += "\n座位:" seat += "\n "; } seat += lists[i].Seat + " "; } this.lbSeats.Text = string.Format(this.lbSeats.Text, seat); this.lbPrice.Text = ticket.Price.ToString(); // WinFormHelper.LocationAfter(this.lbPrice, this.lbTicketPriceHint); this.lbTotalNum.Text = this.lists.Count.ToString(); // WinFormHelper.LocationAfter(this.lbTicketPriceHint, this.lbTicketCount); //WinFormHelper.LocationAfter(this.lbTicketCount, this.lbTicketCountHint); this.lbTotalPrice.Text = (ticket.Price * this.lists.Count).ToString(); // WinFormHelper.LocationAfter(this.lbTicketTotalPrice, this.lbTicketTotalPriceHint); } }
private void btnPay_Click(object sender, EventArgs e) { if (selectedSeat.Count == 0) { return; } if (GlobalTools.GetLoginUser().Balance < Convert.ToDouble(this.lbTotalPrice.Text)) { GlobalTools.Pop(new BuyMoneyHint()); return; } List <TicketPrintObject> tickets = new List <TicketPrintObject>(); System.Collections.IDictionaryEnumerator enumerator = selectedSeat.GetEnumerator(); TicketPrintObject ticket = null; SeatObject seat = null; SystemConfig config = FT.Commons.Cache.StaticCacheManager.GetConfig <SystemConfig>(); while (enumerator.MoveNext()) { ticket = new TicketPrintObject(); seat = enumerator.Value as SeatObject; ticket.Seat = string.Format("{0}排{1}号", seat.RowNum, seat.SeatNo);; ticket.MovieName = movie.Name; ticket.Cinema = config.Cinema; ticket.TicketId = "0000FED001"; ticket.RoomName = roomPlan.RoomName; ticket.Price = Convert.ToInt32(roomPlan.SPrice); ticket.PrintTime = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); ticket.PlayTime = roomPlan.Playtime; ticket.PlayDate = Convert.ToDateTime(roomPlan.Playtime).ToString("yyyy.MM.dd"); ticket.PlanId = roomPlan.PlanId; //ticket.PlanId = roomPlan.PlanId.Substring(0, 16); ticket.SeatId = seat.SeatId; ticket.Phone = GlobalTools.GetLoginUser().Mobile; tickets.Add(ticket); } //GlobalTools.Pop(new CosumeDetailPanel(tickets, movie, moviePlan)); // GlobalTools.GoPanel(new WaitTicketPrintPanel(tickets, movie, moviePlan)); GlobalTools.GoPanel(new UserPayCheckPanel(tickets, movie, moviePlan, roomPlan, dt)); }
public UserPayCheckPanel(List <TicketPrintObject> tickets, MovieObject movie, MoviePlanObject moviePlan, RoomPlanObject roomPlan, DateTime dt) { InitializeComponent(); this.SetSepartor(false); this.lists = tickets; this.movieInfo = movie; this.moviePlan = moviePlan; this.roomPlan = roomPlan; this.dt = dt; if (tickets != null) { TicketPrintObject ticket = tickets[0]; this.picAdImage.Image = movieInfo.AdImage; //ticket.MovieName = "假如真的是爱情有天意的话"; if (ticket.MovieName.Length > 9) { this.lbMovieName.Text = ticket.MovieName.Substring(0, 9) + "\n" + ticket.MovieName.Substring(9); this.lbMovieInfo.Location = new Point(this.lbMovieName.Location.X, this.lbMovieName.Location.Y + this.lbMovieName.Height + 2); } else { this.lbMovieName.Text = ticket.MovieName; } this.lbMovieInfo.Text = string.Format(this.lbMovieInfo.Text, moviePlan.Type, moviePlan.Language, movieInfo.TotalMinutes); //DateTime playDate=Convert.ToDateTime(ticket.PlayDate); // DateTime playDate = movie.PlayTime; DateTime playDate = dt; this.lbDate.Text = playDate.ToString("MM月dd日") + " " + DateTimeHelper.GetChineseXq(playDate); WinFormHelper.LocationAfter(this.lbDate, this.lbDateHint); this.lbTime.Text = ticket.PlayTime; WinFormHelper.LocationAfter(this.lbDateHint, this.lbTime); WinFormHelper.LocationAfter(this.lbTime, this.lbTimeHint); this.lbRoom.Text = ticket.RoomName; WinFormHelper.LocationAfter(this.lbTimeHint, this.lbRoom); //this.lbRoom.Location = new Point(this.lbTimeHint.Location.X + this.lbTimeHint.Width, this.lbTimeHint.Location.Y); int num = 6; string seat = string.Empty; for (int i = 0; i < lists.Count; i++) { if (i != 0 && i % num == 0) { // seat += "\n座位:" seat += "\n "; } seat += lists[i].Seat + " "; } this.lbSeats.Text = string.Format(this.lbSeats.Text, seat); this.lbTicketPrice.Text = ticket.Price.ToString(); WinFormHelper.LocationAfter(this.lbTicketPrice, this.lbTicketPriceHint); this.lbTicketCount.Text = this.lists.Count.ToString(); WinFormHelper.LocationAfter(this.lbTicketPriceHint, this.lbTicketCount); WinFormHelper.LocationAfter(this.lbTicketCount, this.lbTicketCountHint); this.lbTicketTotalPrice.Text = (ticket.Price * this.lists.Count).ToString(); WinFormHelper.LocationAfter(this.lbTicketTotalPrice, this.lbTicketTotalPriceHint); } this.SetOperationTime(30); }