コード例 #1
0
ファイル: Program.cs プロジェクト: Wetski/Demo08
 static void Main(string[] args)
 {
     Invoice invoice = new Invoice() { Customer = "Veeti" };
     InvoiceItem butter = new InvoiceItem() { Name = "Butter", Price = 3.45, Quantity = 1 };
     InvoiceItem cheese = new InvoiceItem() { Name = "Cheese", Price = 4.99, Quantity = 1 };
     InvoiceItem soda = new InvoiceItem() { Name = "Cola", Price = 0.99, Quantity = 6 };
     invoice.AddItem(butter);
     invoice.AddItem(cheese);
     invoice.AddItem(soda);
     invoice.PrintInvoice();
 }
コード例 #2
0
ファイル: Invoice.cs プロジェクト: Wetski/Demo08
 public void AddItem(InvoiceItem item)
 {
     invoice.Add(item);
 }