Exemple #1
0
        }/*private void BtnExit_Click(object sender, EventArgs e)*/

        /// <summary>
        /// This click event handles the firing of the customer's orders to the
        /// KitchenScreenClient. Send all unsent items to the screens.
        /// </summary>
        /// <remarks>
        /// NAME: BtnSendOrdersOnTill_Click
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/13/2019
        /// </remarks>
        /// <param name="sender">The button that triggered the event.</param>
        /// <param name="e">The EventArgs that are associated with the event.</param>
        private void BtnSendOrdersOnTill_Click(object sender, EventArgs e)
        {
            List <string> listOfItems = new List <string>();

            listOfItems = m_customerCheckView.GetUnsentItemsForSending();
            listOfItems.Insert(0, m_customerChecks[m_currentlySelectedTab].Name + '\n');

            if (listOfItems.Count <= 1)
            {
                MessageBox.Show(@"ERR: Empty Check. Please fill the till with items before sending.");
                return;
            }

            if (m_server.NoClients())
            {
                MessageBox.Show(@"ERR: No connection has been established with the server. " +
                                @"Click/Tap the 'Establish Connection with PoS' button on the KitchenScreenClient.");
                return;
            }

            listOfItems.Insert(1, m_customerChecks[m_currentlySelectedTab].GetCheckGUID() + '\n');
            FlagMealsOnTillAsSent();
            string toBeSent = string.Join(string.Empty, listOfItems);

            m_server.SendToAll(toBeSent);
            m_numOfSentLines = m_customerCheckView.GetCountInDisplayOfSentItems();
            UpdateDisplay();
        }/*private void BtnSendOrdersOnTill_Click(object sender, EventArgs e)*/
Exemple #2
0
        }/*private void DeleteItemWithinMealAtIndex(int a_mealIndex, int a_itemIndex)*/

        /// <summary>
        /// This method is called whenever the customer's orders are drawn to the screen. Handles logic
        /// to give a customer's check visual clarity on which orders have been sent to the screens or not.
        /// </summary>
        /// <remarks>
        /// NAME: LbCustomerCheck_DrawItem
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/13/2019
        /// </remarks>
        /// <param name="sender">The object that triggered the event</param>
        /// <param name="e">The EventArgs object for formatting the view of the ListBox</param>
        private void LbCustomerCheck_DrawItem(object sender, DrawItemEventArgs e)
        {
            e.DrawBackground();
            //For when the user clicks on the empty Listbox.
            if (e.Index < 0)
            {
                return;
            }

            string formatable = lbCustomerCheck.Items[e.Index].ToString();

            CustomerCheckView viewTextFormatting = new CustomerCheckView(m_customerChecks[m_currentlySelectedTab]);

            if (e.Index < viewTextFormatting.GetCountInDisplayOfSentItems())
            {
                e.Graphics.DrawString(formatable, new Font("Arial", 10, FontStyle.Italic), Brushes.Black, e.Bounds);
            }
            else
            {
                e.Graphics.DrawString(formatable, new Font("Arial", 10, FontStyle.Bold), Brushes.Black, e.Bounds);
            }

            e.DrawFocusRectangle();
        }/*private void LbCustomerCheck_DrawItem(object sender, DrawItemEventArgs e)*/