public static void Add_Card(string arg1, DateTime arg2, double arg3) { try { Credit_Card c1 = new Credit_Card(arg1, arg2, arg3); Credit_Card_Processor.Save_Card(c1); } finally { //return " Card Added (success indication)" } }
public static Credit_Card Load_Card() { FileStream credit_card_stream = new FileStream("Credit Cards.data", FileMode.Open, FileAccess.Read); BinaryFormatter bf = new BinaryFormatter(); try { Credit_Card c1 = (Credit_Card)bf.Deserialize(credit_card_stream); return(c1); } finally { credit_card_stream.Close(); } }
public static void Save_Card(Credit_Card arg1) { FileStream credit_card_stream = new FileStream("Credit Cards.data", FileMode.Append, FileAccess.Write); BinaryFormatter bf = new BinaryFormatter(); try { bf.Serialize(credit_card_stream, arg1); } finally { credit_card_stream.Close(); number_of_credit_cards++; } }