9.工具类
?
- using System; using System.Collections.Generic;
- using System.Linq; using System.Text;
- using System.Threading.Tasks;
- namespace 影院售票系统 {
- /// <summary> /// 工具类
- /// </summary> public class TicketUtil
- { /// <summary>
- /// 创建电影票 /// </summary>
- /// <returns></returns> public static Ticket CreateTicket(ScheduleItem sch,Seat seat,int discount,string customerName,string type)
- { Ticket ticket=null;
- switch (type) {
- case "StudentTicket": ticket = new StudentTicket(sch,seat,discount);
- break; case "FreeTicket":
- ticket = new FreeTicket(sch,seat,customerName); break;
- default: ticket = new Ticket(sch,seat);
- break; }
- return ticket; }
- } }
下篇文章将继续更新,内容有电影院座位的动态绘制、电影信息绑定到窗体中展现出来,希望大家不要走开,有什么地方需要改进的欢迎大家指出,共同探讨进步。
注:相关教程知识阅读请移步到c#教程频道。










