// Below this method is used when user clicks add button creating an instance of the sale.
 // The if loop checks to see if the method is null and if not null the method adds the sale to the sale listbox.
 private void btnAdd_Click(object sender, System.EventArgs e)
 {
     frmNewSale newSaleForm = new frmNewSale();
     Sale sale = newSaleForm.GetNewSale();
     if (sale != null)
     {
         sales.Add(sale);
         SaleDB.SaveSales(sales);
         FillSaleListBox();
     }
 }
Exemple #2
0
        // Below this method is used when user clicks add button creating an instance of the sale.
        // The if loop checks to see if the method is null and if not null the method adds the sale to the sale listbox.
        private void btnAdd_Click(object sender, System.EventArgs e)
        {
            frmNewSale newSaleForm = new frmNewSale();
            Sale       sale        = newSaleForm.GetNewSale();

            if (sale != null)
            {
                sales.Add(sale);
                SaleDB.SaveSales(sales);
                FillSaleListBox();
            }
        }