1. 首页
  2. 网络技术
  3. 其他
  4. 青鸟影院售票系统

青鸟影院售票系统

上传者: 2019-01-01 22:55:42上传 RAR文件 3.25MB 热度 37次
明白又清楚的资源。 private void lblBuy_Click(object sender, EventArgs e) { IPrintable iprintTicket = TicketFactory.getTicket(); IPrintable iprintStudent = TicketFactory.getSutdent(); IPrintable iprintFree = TicketFactory.getFree(); if (lblMovieName.Text.Trim() == "") { MessageBox.Show("请选择电影!"); return; } string seatNumber = ((Label)sender).Text; ScheduleItem si = c inemaDty[selectStr].SheduleItem; if (rbnPresent.Checked == true && txtPresentName.Text == "") { MessageBox.Show("请填写曾送者的姓名!"); return; } if (rbnStudent.Checked == true && cboStudent.Text == "") { MessageBox.Show("请选择折扣率!"); return; } if (cinemaDty[selectStr].Seats[seatNumber].Color == Color.Red) { MessageBox.Show("此票以售出!"); return; } if (rbnPresent.Checked == true) { DialogResult result = MessageBox.Show("是否购买此票?","信息提示",MessageBoxButtons.YesNo,MessageBoxIcon.Information); if (result==DialogResult.Yes) { seatLabel[seatNumber].BackColor = Color.Red; FreeTicket ticketFree = new FreeTicket(); ticketFree.Price = si.Movie.Price; ticketFree.ScheduleItem = si; ticketFree.Seat = new Seat(seatNumber, seatLabel[seatNumber].BackColor); ticketFree.CustomerName = txtPresentName.Text; Ticket ticket = ticketFree as Ticket; cinemaDty[selectStr].SoldTickets.Add(ticket); lblGetPrice.Text = ticket.Price.ToString(); ticket.Print(); } } else if (rbnStudent.Checked == true) { DialogResult result = MessageBox.Show("是否购买此票?", "信息提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (result == DialogResult.Yes) { seatLabel[seatNumber].BackColor = Color.Red; Ticket ticket = new StudentTicket(); ticket.Price = (int)((si.Movie.Price) * Convert.ToInt32(cboStudent.Text) * 0.1); ticket.ScheduleItem = si; ticket.Seat = new Seat(seatNumber, seatLabel[seatNumber].BackColor); cinemaDty[selectStr].SoldTickets.Add(ticket); lblGetPrice.Text = ticket.Price.ToString(); ticket.Print(); } } else { DialogResult result = MessageBox.Show("是否购买此票?", "信息提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (result == DialogResult.Yes) { TicketFactory.getTicket(); seatLabel[seatNumber].BackColor = Color.Red; Ticket ticket = new Ticket(si.Movie.Price, si, new Seat(seatNumber, seatLabel[seatNumber].BackColor)); cinemaDty[selectStr].SoldTickets.Add(ticket); lblGetPrice.Text = ticket.Price.ToString(); ticket.Print(); } } } inemaDty[selectStr].SheduleItem; if (rbnPresent.Checked == true && txtPresentName.Text == "") { MessageBox.Show("请填写曾送者的姓名!"); return; } if (rbnStudent.Checked == true && cboStudent.Text == "") { MessageBox.Show("请选择折扣率!"); return; } if (cinemaDty[selectStr].Seats[seatNumber].Color == Color.Red) { MessageBox.Show("此票以售出!"); return; } if (rbnPresent.Checked == true) { DialogResult result = MessageBox.Show("是否购买此票?","信息提示",MessageBoxButtons.YesNo,MessageBoxIcon.Information); if (result==DialogResult.Yes) { seatLabel[seatNumber].BackColor = Color.Red; FreeTicket ticketFree = new FreeTicket(); ticketFree.Price = si.Movie.Price; ticketFree.ScheduleItem = si; ticketFree.Seat = new Seat(seatNumber, seatLabel[seatNumber].BackColor); ticketFree.CustomerName = txtPresentName.Text; Ticket ticket = ticketFree as Ticket; cinemaDty[selectStr].SoldTickets.Add(ticket); lblGetPrice.Text = ticket.Price.ToString(); ticket.Print(); } } else if (rbnStudent.Checked == true) { DialogResult result = MessageBox.Show("是否购买此票?", "信息提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (result == DialogResult.Yes) { seatLabel[seatNumber].BackColor = Color.Red; Ticket ticket = new StudentTicket(); ticket.Price = (int)((si.Movie.Price) * Convert.ToInt32(cboStudent.Text) * 0.1); ticket.ScheduleItem = si; ticket.Seat = new Seat(seatNumber, seatLabel[seatNumber].BackColor); cinemaDty[selectStr].SoldTickets.Add(ticket); lblGetPrice.Text = ticket.Price.ToString(); ticket.Print(); } } else { DialogResult result = MessageBox.Show("是否购买此票?", "信息提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information); if (result == DialogResult.Yes) { TicketFactory.getTicket(); seatLabel[seatNumber].BackColor = Color.Red; Ticket ticket = new Ticket(si.Movie.Price, si, new Seat(seatNumber, seatLabel[seatNumber].BackColor)); cinemaDty[selectStr].SoldTickets.Add(ticket); lblGetPrice.Text = ticket.Price.ToString(); ticket.Print(); } } }
用户评论
码姐姐匿名网友 2019-01-01 22:55:43

很有帮助谢谢

码姐姐匿名网友 2019-01-01 22:55:43

可以稍微学习下!!!新手入门

seal64046 2019-01-01 22:55:43

可以借鉴~适合初学。

码姐姐匿名网友 2019-01-01 22:55:43

初学参考还是很有用的。

码姐姐匿名网友 2019-01-01 22:55:43

还不错了,可惜不是java

码姐姐匿名网友 2019-01-01 22:55:43

很不错,内容很全面

码姐姐匿名网友 2019-01-01 22:55:43

功能没完全实现 不过当个模板还是很不错的

码姐姐匿名网友 2019-01-01 22:55:43

功能不够多

码姐姐匿名网友 2019-01-01 22:55:43

功能有些没实现