예제 #1
0
        // Calculates the transaction and displays the amount of change.
        public void finalize(decimal tendered, transactionScreen form)
        {
            decimal change;                     // Stores the amount of change to be given

            change = tendered - totals.total;   // Calculated change

            // If change is negative, throw an error indicating invalid tendered ammount (tendered < total)
            if (change < 0.00M)
            {
                throw new System.ArgumentException("Invalid Tendered Ammount");
            }

            // Set/display change and update the form upon completion of transaction
            form.changeTitleLabel.Visible  = true;
            form.changeLabel.Text          = change.ToString("c");
            form.amountTenderedBox.Enabled = false;
            form.finalizeButton.Enabled    = false;
            form.skuBox.ResetText();
            form.skuBox.Enabled = false;

            // Decrement quantities in database
            for (int i = 0; i < numOfItems; i++)
            {
                form.inventoryTableAdapter.DecreaseQuantity(this.items[i]);
            }
        }
예제 #2
0
파일: homeScreen.cs 프로젝트: strongd/POS
 // Opens up the window to deal with transactions on button click.
 private void transactionButton_Click(object sender, EventArgs e)
 {
     Hide();
     transactionScreen window = new transactionScreen();
     window.ShowDialog();
     Show();
 }
예제 #3
0
파일: homeScreen.cs 프로젝트: DannyTaki/POS
        // Opens up the window to deal with transactions on button click.
        private void transactionButton_Click(object sender, EventArgs e)
        {
            Hide();
            transactionScreen window = new transactionScreen();

            window.ShowDialog();
            Show();
        }
예제 #4
0
파일: Transaction.cs 프로젝트: strongd/POS
        // Adds items to the transaction and increases the item count
        public int AddItem(int sku, transactionScreen form)
        {
            // Attempt to find and fill the table with the SKU
            int returnValue = form.inventoryTableAdapter.FillBySKU(form.pOSDataSet.Inventory, sku);

            // Check if an item was returned, and that the quantity is less than or equal to 0, and display the row in red
            if (returnValue != 0 && form.inventoryTableAdapter.GetQuantity(sku) <= 0)
                form.inventoryDataGridView.Rows[numOfItems].DefaultCellStyle.BackColor = Color.Red;

            // Clear selection of the view upon entry of a sku
            form.inventoryDataGridView.ClearSelection();

            // If an item was returned, increase number of items
            if (returnValue != 0)
            {
                this.items[numOfItems] = sku;
                this.numOfItems++;
            }

            // Return number of items
            return this.numOfItems;
        }
예제 #5
0
파일: Transaction.cs 프로젝트: strongd/POS
        // Calculates the transaction and displays the amount of change.
        public void finalize(decimal tendered, transactionScreen form)
        {
            decimal change;                     // Stores the amount of change to be given
            change = tendered - totals.total;   // Calculated change

            // If change is negative, throw an error indicating invalid tendered ammount (tendered < total)
            if (change < 0.00M)
                throw new System.ArgumentException("Invalid Tendered Ammount");

            // Set/display change and update the form upon completion of transaction
            form.changeTitleLabel.Visible = true;
            form.changeLabel.Text = change.ToString("c");
            form.amountTenderedBox.Enabled = false;
            form.finalizeButton.Enabled = false;
            form.skuBox.ResetText();
            form.skuBox.Enabled = false;

            // Decrement quantities in database
            for (int i = 0; i < numOfItems; i++)
            {
                form.inventoryTableAdapter.DecreaseQuantity(this.items[i]);
            }
        }
예제 #6
0
        // Adds items to the transaction and increases the item count
        public int AddItem(int sku, transactionScreen form)
        {
            // Attempt to find and fill the table with the SKU
            int returnValue = form.inventoryTableAdapter.FillBySKU(form.pOSDataSet.Inventory, sku);

            // Check if an item was returned, and that the quantity is less than or equal to 0, and display the row in red
            if (returnValue != 0 && form.inventoryTableAdapter.GetQuantity(sku) <= 0)
            {
                form.inventoryDataGridView.Rows[numOfItems].DefaultCellStyle.BackColor = Color.Red;
            }

            // Clear selection of the view upon entry of a sku
            form.inventoryDataGridView.ClearSelection();

            // If an item was returned, increase number of items
            if (returnValue != 0)
            {
                this.items[numOfItems] = sku;
                this.numOfItems++;
            }

            // Return number of items
            return(this.numOfItems);
        }
예제 #7
0
파일: Transaction.cs 프로젝트: strongd/POS
 // Updates the total and the labels during the transaction.
 public void UpdateTotals(decimal price, transactionScreen form)
 {
     totals.UpdateTotal(price);
     totals.UpdateTotalLabels(form);
 }
예제 #8
0
파일: Money.cs 프로젝트: DannyTaki/POS
 // Updates total labels
 public void UpdateTotalLabels(transactionScreen form)
 {
     form.subtotalLabel.Text = this.subtotal.ToString("c");
     form.taxLabel.Text      = this.tax.ToString("c");
     form.totalLabel.Text    = this.total.ToString("c");
 }
예제 #9
0
 // Updates the total and the labels during the transaction.
 public void UpdateTotals(decimal price, transactionScreen form)
 {
     totals.UpdateTotal(price);
     totals.UpdateTotalLabels(form);
 }
예제 #10
0
파일: Money.cs 프로젝트: strongd/POS
 // Updates total labels
 public void UpdateTotalLabels(transactionScreen form)
 {
     form.subtotalLabel.Text = this.subtotal.ToString("c");
     form.taxLabel.Text = this.tax.ToString("c");
     form.totalLabel.Text = this.total.ToString("c");
 }