C#影院售票系统毕业设计(1)

2019-12-30 11:02:24王冬梅
  • }  /// <summary> 
  • /// 计算票价  /// </summary> 
  • public override void CalcPrice()  { 
  • this.Price = 0;  } 
  • /// <summary>  /// 打印售票信息 
  • /// </summary>  public override void Print() 
  • {  string info = string.Format("************************************************nt青鸟影院(赠票)n------------------------------------------------n电影名:t{0}n时间:t{1}n座位号:t{2}n姓名:t{3}n************************************************", this.ScheduItem.Movie.MovieName, this.ScheduItem.Time, this.Seat.SeatNum, this.CustomerName); 
  • MessageBox.Show(info);  //存到文件中 
  • string fileName = this.ScheduItem.Time.Replace(":", "-") + " " + this.Seat.SeatNum + ".txt";  FileStream fs = new FileStream(fileName, FileMode.Create); 
  • StreamWriter sw = new StreamWriter(fs);  sw.Write(info); 
  • sw.Close();  fs.Close(); 
  • }  /// <summary> 
  • /// 显示当前售出票信息  /// </summary> 
  • public override void Show()  { 
  • MessageBox.Show("已售出!n赠票!");  } 
  • }  }  ?

    6.ScheduleItem:影院每天计划放映计划的场次,保存每场电影的信息

    放映时间属性(Time):string类型

    本场所放映电影属性(Movie):Movie自定义类型
     

    1. using System;  using System.Collections.Generic; 
    2. using System.Linq;  using System.Text; 
    3. using System.Threading.Tasks;    
    4.  namespace 影院售票系统   { 
    5.  /// <summary>   /// 影院每天计划放映的场次,保存每场电影的信息 
    6.  /// </summary>   public class ScheduleItem