Example #1
0
 private void Purchasebtn_Click(object sender, EventArgs e)
 {
     using (Confirmation form = new Confirmation("Are you sure you want to make this purchase?"))
     {
         var result = form.ShowDialog();
         if (result == DialogResult.OK)
         {
             invoice = calculations.CalculateInvoice(customer, invoice, userewardschkbx.Checked);
             invoice.DateOfInvoice = DateTime.Now;
             if (DatabaseOperation.AddItem(invoice))
             {
                 MessageBox.Show("Successfully added the item into the database.");
                 this.Close();
             }
             else
             {
                 MessageBox.Show("Something went wrong, please try again");
             }
         }
     }
 }