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)" } }
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(); } }
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++; } }