Exemplo n.º 1
0
        private void Button_PrintDraft_Click(object sender, RoutedEventArgs e)
        {
            //Reset selectedTableRow
            TableTableOrder.ConvertTableOrderToTableRow(thisTableOrder);

            thisTableOrder.SetTableStatus(TableOrder.PRESETTLEMENT_BILL);

            DisableTableTableOrder();

            disableAddItemForm();
        }
Exemplo n.º 2
0
        //
        //
        //  VINCENT - END
        //
        //

        //
        //
        //  WILSON - START
        //
        //


        private void AddItemToTableOrder(string commaSeparatedItemDetails)
        {
            //Get tableorder from tableordercollection using table number
            int tableNumber = Int32.Parse(fTableOrder.TextBlock_TableNum.Text.Replace("TABLE ", ""));

            String[] itemDetails = commaSeparatedItemDetails.Split(',');

            TableOrder tableOrder = GetTableOrderFromTableNumber(tableNumber);

            //add item to tableorder
            tableOrder.AddItemOrder(itemDetails[0],
                                    Int32.Parse(itemDetails[1]),
                                    Double.Parse(itemDetails[2]));

            //update ui element
            fTableOrder.TableTableOrder.ConvertTableOrderToTableRow(tableOrder);

            fTableOrder.UpdateSumTaxTotal(tableOrder.GetSumTaxTotal());
            fTableOrder.TogglePrintDraftButtonState();

            if (tableOrder.GetItemsOrdered().Count > 0)
            {
                tableOrder.SetTableStatus(TableOrder.OPEN_BILL);
            }
        }
Exemplo n.º 3
0
        internal void CloseForm(UserControl userControl)
        {
            //Parent_Grid.Children.Remove(userControl);

            userControl.Visibility = Visibility.Hidden;

            TableOrder tableOrder = fTableOrder.GetTableOrder();

            //Closing Form_TableOrder will also close Form_AddItem and Form_Payment (if they are inflated)
            if (userControl.Name == "FormTableOrder")
            {
                GreyBackdrop.Visibility = Visibility.Hidden;

                try
                {
                    CloseForm(fAddItem);
                    CloseForm(fPayment);
                }
                catch
                {
                    //nothing
                }

                //Change TableOrder.Status and table color
                Button buttonTable = (selectedTable as Button);

                int status = tableOrder.GetTableStatus();

                if (status == TableOrder.CLOSED_BILL)
                {
                    tableOrder.SetTableStatus(TableOrder.TABLE_EMPTY);
                    status = TableOrder.TABLE_EMPTY;
                }

                ChangeTableColor(buttonTable, status);
            }

            else if (userControl.Name == "FormAddItem")
            {
                if (tableOrder.GetTableStatus() == TableOrder.PRESETTLEMENT_BILL ||
                    tableOrder.GetTableStatus() == TableOrder.CLOSED_BILL)
                {
                    // do nothing
                }
                else
                {
                    fTableOrder.Button_ItemForm.IsEnabled = true;
                }
            }
        }
Exemplo n.º 4
0
        internal void DeleteItemFromTableOrder(TableRow tableRow)
        {
            //remove item from TableOrder
            int tableNumber = Int32.Parse(fTableOrder.TextBlock_TableNum.Text.Replace("TABLE ", ""));

            TableOrder tableOrder = GetTableOrderFromTableNumber(tableNumber);

            tableOrder.RemoveItemOrder(tableRow);

            //UpdateUIElements
            fTableOrder.TableTableOrder.ConvertTableOrderToTableRow(tableOrder);

            fTableOrder.UpdateSumTaxTotal(tableOrder.GetSumTaxTotal());
            fTableOrder.TogglePrintDraftButtonState();

            if (tableOrder.GetItemsOrdered().Count < 1)
            {
                tableOrder.SetTableStatus(TableOrder.TABLE_EMPTY);
            }
        }