コード例 #1
0
        public static void Add_Ticket(string arg1, double arg2)
        {
            try
            {
                E_Ticket e1 = new E_Ticket(arg1, arg2);
                E_Ticket_Processor.Save_Ticket(e1);
            }

            finally
            {
                //return " E-Ticket Added (success indication)"
            }
        }
コード例 #2
0
        public static E_Ticket Load_Ticket()
        {
            FileStream      E_Ticket_stream = new FileStream("E-Tickets.data", FileMode.Open, FileAccess.Read);
            BinaryFormatter bf = new BinaryFormatter();

            try
            {
                E_Ticket e1 = (E_Ticket)bf.Deserialize(E_Ticket_stream);
                return(e1);
            }

            finally
            {
                E_Ticket_stream.Close();
            }
        }
コード例 #3
0
        public static void Save_Ticket(E_Ticket arg1)
        {
            FileStream      E_Ticket_stream = new FileStream("E-Tickets.data", FileMode.Append, FileAccess.Write);
            BinaryFormatter bf = new BinaryFormatter();

            try
            {
                bf.Serialize(E_Ticket_stream, arg1);
            }

            finally
            {
                E_Ticket_stream.Close();
                number_of_e_tickets++;
            }
        }