Question: ServiceInvoice Class This class contains functionality that supports the business process of creating an invoice for the service department. The ServiceInvoice class derives from the
ServiceInvoice Class
This class contains functionality that supports the business process of creating an invoice for the service department. The ServiceInvoice class derives from the Invoice class.
Create the ServiceInvoice class in the Library project. This class must be defined under the My.Business namespace.
Properties
LabourCost : decimal
Gets the amount charged for labour.
PartsCost : decimal
Gets the amount charged for parts.
MaterialCost : decimal
Gets the amount charged for shop materials.
ProvincialSalesTaxCharged : decimal
Gets the amount of provincial sales tax charged to the customer. Provincial Sales Tax is not applied to labour cost.
GoodsAndServicesTaxCharged : decimal
Gets the amount of goods and services tax charged to the customer.
SubTotal : decimal
Gets the subtotal of the Invoice.
Total : decimal
Gets the total of the Invoice.
The LabourCost, PartsCost and MaterialCost properties have a private set accessor.
Methods
ServiceInvoice(decimal, decimal)
Initializes an instance of ServiceInvoice with a provincial and goods and services tax rates.
Parameters:
- provincialSalesTaxRate - The rate of provincial tax charged to a customer.
- goodsAndServicesTaxRate - The rate of goods and services tax charged to a customer.
Exceptions:
- ArgumentOutOfRangeException - When the provincial sales tax rate is less than 0. Message: The argument cannot be less than 0. Parameter name: "provincialSalesTaxRate".
- ArgumentOutOfRangeException - When the provincial sales tax rate is greater than 1. Message: The argument cannot be greater than 1. Parameter name: "provincialSalesTaxRate".
- ArgumentOutOfRangeException - When the goods and services tax rate is less than 0. Message: The argument cannot be less than 0. Parameter name: "goodsAndServicesTaxRate".
- ArgumentOutOfRangeException - When the goods and services tax rate is greater than 1. Message: The argument cannot be greater than 1. Parameter name: "goodsAndServicesTaxRate".
AddCost(CostType, decimal) : void
Increments a specified cost by the specified amount.
Parameters:
- type - The type of cost being incremented.
- amount - The amount the cost is being incremented by.
Exceptions:
- System.ComponentModel.InvalidEnumArgumentException - When the cost type is an invalid argument. Message: "The argument is an invalid enumeration value".
- ArgumentOutOfRangeException - When the amount is less than or equal to 0. Message: The argument cannot be less than or equal to 0. Parameter name: "amount".
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
