"青鸟影院"三分之二
来源:互联网 发布:mac无线键盘 防水 编辑:程序博客网 时间:2024/04/29 01:39
//FreeTicket.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace 青鸟影院
{
[Serializable]
/// <summary>
/// 赠票
/// </summary>
public class FreeTicket:Ticket
{
public FreeTicket() { }
public FreeTicket(string customerName,ScheduleItem scheduleItem,Seat seat):base(scheduleItem,seat)
{
this.CustomerName = customerName;
this.Price = CalcPrice();
}
//赠票人姓名
public string CustomerName { get; set; }
/// <summary>
/// 计算赠票票价
/// </summary>
/// <returns></returns>
public override double CalcPrice()
{
return 0;
}
/// <summary>
/// 打印赠票
/// </summary>
public override void Print()
{
string path = (this.ScheduleItem.Time + " " + this.Seat.SeatNum).Replace(":", "-") + ".txt";
using (FileStream fs = new FileStream(path, FileMode.Create))
{
using (StreamWriter sw = new StreamWriter(fs, Encoding.Default))
{
sw.WriteLine("*******************************");
sw.WriteLine(" 青鸟影院(赠票) ");
sw.WriteLine("-------------------------------");
sw.WriteLine("电影名:" + ScheduleItem.Movie.MovieName);
sw.WriteLine("时间:" + this.ScheduleItem.Time);
sw.WriteLine("座位号:" + this.Seat.SeatNum);
sw.WriteLine("赠送人:"+this.CustomerName);
sw.WriteLine("价格:" + this.Price);
sw.WriteLine("*******************************");
}
}
}
}
}
//Movie.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 青鸟影院
{
[Serializable]
/// <summary>
/// 电影类
/// </summary>
public class Movie
{
public Movie() { }
public Movie(string actor, string director, string movieName, MovieType movieType, string poster, double price)
{
this.Actor = actor;
this.Director = director;
this.MovieName = movieName;
this.MovieType = movieType;
this.Poster = poster;
this.Price = price;
}
//导演
public string Actor { get; set; }
//演员
public string Director { get; set; }
//电影名
public string MovieName { get; set; }
//电影类型
public MovieType MovieType { get; set; }
//海报路径
public string Poster { get; set; }
//电影价格
public double Price { get; set; }
}
}
//Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace 青鸟影院
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new FrmCinema());
}
}
}
//Schedule.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
namespace 青鸟影院
{
[Serializable]
/// <summary>
/// 放映计划类
/// </summary>
public class Schedule
{
public Schedule() { Items = new Dictionary<string, ScheduleItem>(); }
public Schedule(Dictionary<string, ScheduleItem> items)
{
this.Items = items;
}
public Dictionary<string, ScheduleItem> Items { get; set; }
//加载XML中的放映场次信息
public void LoadItems()
{
try
{
XmlDocument doc = new XmlDocument();
doc.Load(@"Data\ShowList.xml");
XmlNode root = doc.DocumentElement;
foreach (XmlNode var in root.ChildNodes)//Movie
{
Movie movie = new Movie();
foreach (XmlNode var2 in var.ChildNodes)//Name
{
switch (var2.Name)
{
case "Name":
movie.MovieName = var2.InnerText;
break;
case "Poster":
movie.Poster = var2.InnerText;
break;
case "Director":
movie.Director = var2.InnerText;
break;
case "Actor":
movie.Actor = var2.InnerText;
break;
case "Price":
movie.Price = Convert.ToDouble(var2.InnerText);
break;
case "Type":
movie.MovieType = (MovieType)Enum.Parse(typeof(MovieType), var2.InnerText);
break;
case "Schedule":
foreach (XmlNode var3 in var2.ChildNodes)//Item
{
ScheduleItem item = new ScheduleItem(movie, var3.InnerText);
this.Items.Add(var3.InnerText, item);
}
break;
}
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}
- "青鸟影院"三分之二
- "青鸟影院"三分之一
- 青鸟影院售票系统
- "青鸟影院"的最后一部分
- 深入.NET 青鸟影院系统
- 青鸟影院售票系统(一)
- 三分之二
- 摄像头屏幕三分之二显示
- 影院售票
- 人生另外三分之二的风景
- 青鸟-故乡
- 北大青鸟
- 北大青鸟
- 北大青鸟
- 北大青鸟
- 北大青鸟
- 北大青鸟
- 北大青鸟
- TextView设置android:ellipsize="marquee"属性,无法实现跑马灯效果的解决方法
- (第2篇)一篇文章教你轻松安装hadoop
- 猎奇!THUWC2017试机题
- 中间层驱动工作原理
- 是否一定要执行构造函数
- "青鸟影院"三分之二
- html代码在网页端显示正常,在手机端调用,造成字体、图片有误差解决方式
- 解决FTP上传时报550错误的问题 “远程服务器返回错误: (550) 文件不可用(例如,未找到文件,无法访问文件)。”
- MySQL主从复制--实现读写分离
- 编写高性能JavaScript
- 树状数组的基本操作
- 【Zookeeper】源码分析之Leader选举(二)
- mysql 不能启动的两种错误提示及解决方法
- 怎么知道索引是否生效