예제 #1
0
        private void BuyItemButton_Click(object sender, EventArgs e)
        {
            SalesInvoice newTicket = new SalesInvoice();
            newTicket.NumberOfItems = int.Parse(NumberOfItemsInput.Text);
            newTicket.UnitPrice = double.Parse(UnitPriceInput.Text);

            newTicket.CalculatePrice();

            MessageBox.Show(string.Format("Sales...\nQuantity: {0} units\nUnit Price: {1:C} each\n----------------------------\nNet Price: {2:C}\nState Sales Tax: {3:C}\nLocal Sales Tax: {4:C}\nFinal Price: {5:C}", newTicket.NumberOfItems, newTicket.UnitPrice, newTicket.NetPrice, newTicket.StateSalesTaxAmount, newTicket.LocalSalesTaxAmount, newTicket.FinalPrice));
        }