Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace Indexers
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void textBox2_TextChanged(object sender, EventArgs e)
- {
- }
- private void btnDisplay_Click(object sender, EventArgs e)
- {
- Invoice inv = new Invoice(txtInvoiceNumber.Text, txtDescription.Text, int.Parse(txtQuantity.Text), Convert.ToDecimal(txtPrice.Text));
- InvoiceList myList = new InvoiceList();
- myList.Add(inv);
- decimal x = myList[0].GetInvoiceAmount();
- txtOutput.Text += inv.ToString() + " , " + " Invoice Amount is: " + x.ToString("c")+ "\r\n";
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void btnExit_Click(object sender, EventArgs e)
- {
- string message = "Are you sure you want to close the form ?";
- DialogResult button = MessageBox.Show(message, "Confirm",
- MessageBoxButtons.YesNo);
- if (button == DialogResult.Yes)
- {
- this.Close();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement