• 大小: 1.12MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-09
  • 语言: 其他
  • 标签:

资源简介

影院售票系统简介,本系统根据不同的人群来完成不同的订票,普通票、 学生票和免费票基本上实现了电影院售票系统的基本功能。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Windows.Forms;
using System.xml;
using System.Drawing;
namespace Chapter_Eleven_project
{
    //影院类,保存放映计划和座位类
    public class Cinema
    {
        //座位集合
       public static Dictionary Seats = new Dictionary();

        //放映计划
       public static Schedule schedule { get; set; }//放映计划

        //已出售电影票的集合
       public static List SoldTickets = new List();

       //座位控件集合
       public static Dictionary labels = new Dictionary();

        //保存售票情况方法
        public static void Save()
        {
            string str = @“““1.0“““;
            string str1 = @“““UTF-8“““;
            string URL = @“D:\Visual Studio\S2作业\Chapter_Eleven_project\backups.xml“;
            //创建文件流
            FileStream FS = new FileStream(URLFileMode.Create);
            //创建写入器
            StreamWriter SW = new StreamWriter(FS);
            //开始写入
            SW.WriteLine(@“l version=“+str+ “ encoding=“+str1+“?>“);
            SW.WriteLine(““);
            foreach (Ticket item in SoldTickets)
            {
                SW.WriteLine(““);
                //座位信息
                SW.WriteLine(““ + item.seat.SeatNum + ““);
                //SW.WriteLine(““ + item.seat.Color + ““);
                //播放时间
                SW.WriteLine(““);
                //电影属性信息
                SW.WriteLine(““ + item.scheduleltem.movie.MovieName + ““);
                SW.WriteLine(““ + item .scheduleltem.movie.Poster+ ““);
                SW.WriteLine(““ + item.scheduleltem.movie.Director + ““);
                SW.WriteLine(““ + item.scheduleltem.movie.Actor + ““);
                SW.WriteLine(““ + item.scheduleltem.movie.Type + ““);
                SW.WriteLine(““ + item.scheduleltem.movie.Price + ““);

                SW.WriteLine(““+item.Price+““);
                SW.WriteLine(“
“);
            }
            SW.WriteLine(“
“);
            SW.Close();
            FS.Close();
         
        }
        //读取售票情况方法
        public static void Load() 
        {
            string URL = @“D:\Visual Studio\S2作业\Chapter_Eleven_project\backups.xml“;
            //获取文件大小判断是否存盘
            FileInfo info = new FileInfo(URL);
            double size = info.Length;
            //如果文件大小等于零就结束读取
            if (size == 0.0) { MessageBox.Show(“没有存盘:将开始新的售票““温馨提示“MessageBoxButtons.OKMessageBoxIcon.Warning); return; }
            //读取上次运行记录
            //创建读取xml文件类
            xmlDocument doc = new xmlDocument();
            //加载xml文件结构
            doc.Load(@“D:\Visual Studio\S2作

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-01-14 19:43  Chapter_Eleven_project\
     目录           0  2018-01-13 08:17  Chapter_Eleven_project\Chapter_Eleven_project\
     文件         187  2018-01-04 11:54  Chapter_Eleven_project\Chapter_Eleven_project\App.config
     文件        4312  2018-01-13 08:22  Chapter_Eleven_project\Chapter_Eleven_project\Chapter_Eleven_project.csproj
     文件        4769  2018-01-14 20:12  Chapter_Eleven_project\Chapter_Eleven_project\Cinema.cs
     文件        3288  2018-01-12 15:58  Chapter_Eleven_project\Chapter_Eleven_project\ClassDiagram1.cd
     文件        1787  2018-01-13 00:25  Chapter_Eleven_project\Chapter_Eleven_project\FreeTicket.cs
     文件       23322  2018-01-14 14:59  Chapter_Eleven_project\Chapter_Eleven_project\FrmMain.Designer.cs
     文件       12694  2018-01-14 20:09  Chapter_Eleven_project\Chapter_Eleven_project\FrmMain.cs
     文件      259340  2018-01-14 14:59  Chapter_Eleven_project\Chapter_Eleven_project\FrmMain.resx
     文件         556  2018-01-05 20:32  Chapter_Eleven_project\Chapter_Eleven_project\Movie.cs
     文件         299  2018-01-05 20:33  Chapter_Eleven_project\Chapter_Eleven_project\MovieType.cs
     文件        1304  2018-01-13 08:22  Chapter_Eleven_project\Chapter_Eleven_project\OrdianryTicket.cs
     文件         536  2018-01-04 11:55  Chapter_Eleven_project\Chapter_Eleven_project\Program.cs
     目录           0  2018-01-04 11:54  Chapter_Eleven_project\Chapter_Eleven_project\Properties\
     文件        1364  2018-01-04 11:54  Chapter_Eleven_project\Chapter_Eleven_project\Properties\AssemblyInfo.cs
     文件        2896  2018-01-04 11:54  Chapter_Eleven_project\Chapter_Eleven_project\Properties\Resources.Designer.cs
     文件        5612  2018-01-04 11:54  Chapter_Eleven_project\Chapter_Eleven_project\Properties\Resources.resx
     文件        1109  2018-01-04 11:54  Chapter_Eleven_project\Chapter_Eleven_project\Properties\Settings.Designer.cs
     文件         249  2018-01-04 11:54  Chapter_Eleven_project\Chapter_Eleven_project\Properties\Settings.settings
     文件        2192  2018-01-12 21:36  Chapter_Eleven_project\Chapter_Eleven_project\Schedule.cs
     文件         412  2018-01-05 20:55  Chapter_Eleven_project\Chapter_Eleven_project\Scheduleltem.cs
     文件         377  2018-01-05 20:26  Chapter_Eleven_project\Chapter_Eleven_project\Seat.cs
     文件        1851  2018-01-13 08:21  Chapter_Eleven_project\Chapter_Eleven_project\StudentTicket.cs
     文件         990  2018-01-13 00:18  Chapter_Eleven_project\Chapter_Eleven_project\Ticket.cs
     文件         958  2018-01-13 08:23  Chapter_Eleven_project\Chapter_Eleven_project\TicketUtil.cs
     目录           0  2018-01-04 11:54  Chapter_Eleven_project\Chapter_Eleven_project\bin\
     目录           0  2018-01-06 08:48  Chapter_Eleven_project\Chapter_Eleven_project\bin\Debug\
     文件      199168  2018-01-14 20:12  Chapter_Eleven_project\Chapter_Eleven_project\bin\Debug\Chapter_Eleven_project.exe
     文件         187  2018-01-04 11:54  Chapter_Eleven_project\Chapter_Eleven_project\bin\Debug\Chapter_Eleven_project.exe.config
     文件       65024  2018-01-14 20:12  Chapter_Eleven_project\Chapter_Eleven_project\bin\Debug\Chapter_Eleven_project.pdb
............此处省略27个文件信息

评论

共有 条评论