青鸟影院售票系统
明白又清楚的资源。 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 = cinemaDty[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(); } } }
- 1
- 2
- 3
- 粉丝: 0
- 资源: 1
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
- 1
- 2
- 3
- 4
- 5
- 6
前往页