}/*public ScreenView(FlowLayoutPanel a_screen)*/

        /// <summary>
        /// Adds each OnScreenOrder object to the Screen's View.
        /// </summary>
        /// <remarks>
        /// NAME: AddElementToScreen
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/17/2019
        /// </remarks>
        /// <param name="a_order">The OnScreenOrder object that contains
        /// the parsed data that will be displayed on the view.</param>
        /// <param name="a_color">The Color of the order, indicating which order the
        /// cursor is currently on.</param>
        public void AddElementToScreen(OnScreenOrder a_order, Color a_color)
        {
            OnScreenOrderControl newOrderOnScreen = new OnScreenOrderControl {
                BackColor = a_color
            };

            newOrderOnScreen.PostRegularElementsToControl(a_order);
            newOrderOnScreen.PostVoidedElementsToControl(a_order);
            newOrderOnScreen.FinalizeOnScreenInfo();

            m_screen.Controls.Add(newOrderOnScreen);
        }/*public void AddElementToScreen(OnScreenOrder a_order, Color a_textBoxColor)*/
Beispiel #2
0
        }/*private void UpdateScreenView()*/

        /// <summary>
        /// This method is responsible for adding new data to the
        /// screen's model.
        /// </summary>
        /// <remarks>
        /// NAME: ConvertDataFromPoSIntoScreenElement
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/17/2019
        /// </remarks>
        /// <param name="a_message">The raw data from the server - the MainPoSMenu</param>
        public void ConvertDataFromPoSIntoScreenElement(string a_message)
        {
            a_message = a_message.Trim('\0');

            if (a_message.Contains(m_voidCommand))
            {
                SearchForVoidCandidate(a_message);
            }
            else
            {
                OnScreenOrder newOnScreenOrder = new OnScreenOrder();
                newOnScreenOrder.ParseSentStringIntoOrder(a_message);
                m_customerOrders.Add(newOnScreenOrder);
            }

            UpdateScreenView();
        }/*public void ConvertDataFromPoSIntoScreenElement(string a_message)*/
Beispiel #3
0
        }/*public void PostRegularElementsToControl(OnScreenOrder a_screenOrder)*/

        /// <summary>
        /// Accesses the elements of the voided orders list and posts them to voided list in this control.
        /// </summary>
        /// <remarks>
        /// NAME: PostVoidedElementsToControl
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/30/2019
        /// </remarks>
        /// <param name="a_screenOrder">The OnScreenOrder object from which to void from.</param>
        public void PostVoidedElementsToControl(OnScreenOrder a_screenOrder)
        {
            for (int i = 0; i < a_screenOrder.GetSizeOfVoidedOrders(); i++)
            {
                Label  onScreenElement = new Label();
                string element         = a_screenOrder.GetVoidedElementAtIndex(i);
                if (element.Contains('\t'))
                {
                    element = element.Replace("\t", string.Empty);
                    onScreenElement.Text = "    " + element;
                }
                else
                {
                    onScreenElement.Text = element;
                }
                onScreenElement.Font = new Font(onScreenElement.Font, FontStyle.Strikeout);
                m_voidedLabels.Add(onScreenElement);
            }
        }/*public void PostVoidedElementsToControl(OnScreenOrder a_screenOrder)*/
Beispiel #4
0
        }/*public OnScreenOrderControl()*/

        /// <summary>
        /// Accesses the elements of the active order's list and posts them to active orders list in this control.
        /// </summary>
        /// <remarks>
        /// NAME: PostRegularElementsToControl
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/30/2019
        /// </remarks>
        /// <param name="a_screenOrder">The OnScreenOrder object from which to post from.</param>
        public void PostRegularElementsToControl(OnScreenOrder a_screenOrder)
        {
            for (int i = 0; i < a_screenOrder.GetSizeOfRegularOrders(); i++)
            {
                Label onScreenElement = new Label();

                string element = a_screenOrder.GetElementAtIndex(i);
                if (element.Contains('\t'))
                {
                    element = element.Replace("\t", string.Empty);
                    onScreenElement.Text = "    " + element;
                }
                else
                {
                    onScreenElement.Text = element;
                }

                m_activeLabels.Add(onScreenElement);
            }
        }/*public void PostRegularElementsToControl(OnScreenOrder a_screenOrder)*/