本文整理汇总了C#中Invoice.GetInvoiceAmount方法的典型用法代码示例。如果您正苦于以下问题:C# Invoice.GetInvoiceAmount方法的具体用法?C# Invoice.GetInvoiceAmount怎么用?C# Invoice.GetInvoiceAmount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Invoice
的用法示例。
在下文中一共展示了Invoice.GetInvoiceAmount方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Print
// Prints the result
private static void Print(Invoice i)
{
Console.WriteLine("Part Number:\t{0}", i.PartNumber);
Console.WriteLine("Descritpion:\t{0}", i.Description);
Console.WriteLine("Quantity:\t{0}", i.Quantity);
Console.WriteLine("Price:\t\t{0}", i.Price);
Console.WriteLine("Invoice amount:\t{0}\n", i.GetInvoiceAmount());
}
示例2: Main
// Entry point to the application
public static void Main(string[] args)
{
// Intialize the invoice
Invoice invoice1 = new Invoice("1234", 50, 9.89M, "Sheetrock 4ft x 8ft");
Console.WriteLine("Part Number: {0}", invoice1.PartNumber); // Print part number
Console.WriteLine("Quantity: {0}", invoice1.Quantity); // Print quanity
Console.WriteLine("Price Per Item: {0:C}", invoice1.PricePerItem); // Print price per item
Console.WriteLine("Description: {0}", invoice1.Description); // Print description
Console.WriteLine("Invoice Amount: {0:C}", invoice1.GetInvoiceAmount()); // Print the invoice amount total
}
示例3: Main
static void Main(string[] args)
{
string partDescription = "item";
string partNumber = "101";
decimal pricePerItem = 2.5M;
int quantity = 5;
Invoice invoice = new Invoice(partDescription, partNumber, pricePerItem, quantity);
Console.WriteLine(invoice.GetInvoiceAmount());
}