コード例 #1
0
ファイル: Transaction.cs プロジェクト: DannyTaki/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]);
            }
        }
コード例 #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
ファイル: Transaction.cs プロジェクト: DannyTaki/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);
        }
コード例 #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
ファイル: Transaction.cs プロジェクト: DannyTaki/POS
 // 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");
 }