• 大小: 648KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-07
  • 语言: C#
  • 标签: C#  C#源码  

资源简介

用C#做的影院售票系统,包括数据库和项目,基本功能都已实现,其他的功能可以根据需要自行扩展。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
using System.Windows.Forms;

namespace CinemaSystem
{
    public class Cinema
    {
        public Cinema()
        {
            seats = new Dictionary();
            schedule = new Schedule();
            soldTickets = new List();
        }

        //座位集合属性
        private Dictionary seats;
        public Dictionary Seats
        {
            get { return seats; }
            set { seats = value; }
        }  
        //放映计划
        private Schedule schedule;
        public Schedule Schedule
        {
            get { return schedule; }
            set { schedule = value; }
        }
        //已售出电影票的集合
        private List soldTickets;
        public List SoldTickets
        {
            get { return soldTickets; }
            set { soldTickets = value; }
        }

        //保存销售情况的Save方法
        public void Save()
        {
            try
            {
                FileStream fs = new FileStream(“SoldTickets.bin“ FileMode.Create);
                BinaryFormatter bf = new BinaryFormatter();
                bf.Serialize(fs SoldTickets);
                fs.Close();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
            finally
            {
                MessageBox.Show(“保存成功!“);
            }
        }
        //Load方法
        public void Load()
        {
            FileStream fs = new FileStream(“SoldTickets.bin“ FileMode.Open);
            BinaryFormatter bf = new BinaryFormatter();
            SoldTickets = (List)bf.Deserialize(fs);
            fs.Close();
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        925  2009-02-22 15:27  CinemaSystem\CinemaSystem.sln

    ..A..H.     27648  2009-03-03 09:40  CinemaSystem\CinemaSystem.suo

     文件       3832  2009-02-25 14:51  CinemaSystem\CinemaSystem\CinemaSystem.csproj

     文件        474  2009-02-22 15:27  CinemaSystem\CinemaSystem\Program.cs

     文件       1648  2009-02-24 23:42  CinemaSystem\CinemaSystem\Movie.cs

     文件        172  2009-02-23 09:07  CinemaSystem\CinemaSystem\IPrintable.cs

     文件        194  2009-02-23 08:42  CinemaSystem\CinemaSystem\MovieType.cs

     文件        875  2009-02-24 23:18  CinemaSystem\CinemaSystem\ScheduleItem.cs

     文件        755  2009-02-24 23:40  CinemaSystem\CinemaSystem\Seat.cs

     文件       1959  2009-02-24 23:18  CinemaSystem\CinemaSystem\Ticket.cs

     文件        168  2009-02-23 17:31  CinemaSystem\CinemaSystem\CinemaSystem.csproj.user

     文件       1604  2009-02-24 23:18  CinemaSystem\CinemaSystem\StudentTicket.cs

     文件        835  2009-02-23 16:02  CinemaSystem\CinemaSystem\TicketFactory.cs

     文件      11213  2009-02-25 15:00  CinemaSystem\CinemaSystem\MainForm.cs

     文件      28555  2009-02-25 15:00  CinemaSystem\CinemaSystem\MainForm.Designer.cs

     文件       6583  2009-02-25 15:00  CinemaSystem\CinemaSystem\MainForm.resx

     文件       3341  2009-02-24 23:18  CinemaSystem\CinemaSystem\Schedule.cs

     文件       1948  2009-02-24 23:21  CinemaSystem\CinemaSystem\Cinema.cs

     文件       1509  2009-02-24 23:41  CinemaSystem\CinemaSystem\FreeTicket.cs

     文件        306  2009-03-03 09:40  CinemaSystem\CinemaSystem\obj\CinemaSystem.csproj.FileList.txt

     文件        180  2009-02-25 15:00  CinemaSystem\CinemaSystem\obj\Debug\CinemaSystem.MainForm.resources

     文件        180  2009-02-24 23:32  CinemaSystem\CinemaSystem\obj\Debug\CinemaSystem.Properties.Resources.resources

     文件      79360  2009-02-25 15:00  CinemaSystem\CinemaSystem\obj\Debug\CinemaSystem.pdb

     文件      40960  2009-02-25 15:00  CinemaSystem\CinemaSystem\obj\Debug\CinemaSystem.exe

     文件       5712  2009-02-25 14:51  CinemaSystem\CinemaSystem\obj\Debug\ResolveAssemblyReference.cache

     文件        845  2009-02-26 23:02  CinemaSystem\CinemaSystem\obj\Debug\CinemaSystem.csproj.GenerateResource.Cache

     文件       5632  2005-11-11 22:25  CinemaSystem\CinemaSystem\bin\Debug\CinemaSystem.vshost.exe

     文件        926  2009-02-23 16:31  CinemaSystem\CinemaSystem\bin\Debug\ShowList.xml

     文件     569533  2007-10-26 11:49  CinemaSystem\CinemaSystem\bin\Debug\bone.jpg

     文件       8376  2007-10-25 15:52  CinemaSystem\CinemaSystem\bin\Debug\gongfu.jpg

............此处省略42个文件信息

评论

共有 条评论