Exemplo n.º 1
0
        }/*public AttributeModification()*/

        /// <summary>
        /// A constructor for the AttributeModification form. Inherits from the default
        /// constructor and passes in a Entree as an argument.
        /// Initializes all vital members for the entree modifications.
        /// </summary>
        /// <remarks>
        /// NAME: AttributeModification
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/17/2019
        /// </remarks>
        /// <param name="a_entreeFromMain">The entree to be modified.</param>
        public AttributeModification(Entree a_entreeFromMain) : this()
        {
            m_entreeToBeModified = a_entreeFromMain;
            m_attributes         = m_entreeToBeModified.DecomposeAttributes();
            m_entreeView         = new EntreeView(m_entreeToBeModified);
            m_entreeView.DecomposeAttributesToString();
            lbModifiedEntree.DataSource = m_entreeView.GetTextMods();

            GenerateAttributeButtonListAndSetProperties();
            GenerateOriginalAttrs();
            CompleteButtonDisplay();
        }/*public AttributeModification(Entree a_entreeFromMain) : this()*/
Exemplo n.º 2
0
        }/*public void FillMealDisplay()*/

        /// <summary>
        /// Parses the EntreeView into suitable view strings. Uses null-coalescing operator to parse
        /// out potential exceptions. Adds the line break for parsing after the entire entree with any
        /// modifiers is added.
        /// </summary>
        /// <remarks>
        /// NAME: PerformEntreeViewFormatting
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/15/2019
        /// </remarks>
        private void PerformEntreeViewFormatting()
        {
            EntreeView ev = GetEntreeForDisplay();

            ev.DecomposeAttributesToString();

            foreach (string item in ev.GetTextMods())
            {
                m_mealDisplay.Add(item ?? "");
            }
            m_mealDisplay.Add(m_lineBreakForParsing);
        }/*private void PerformEntreeViewFormatting()*/
Exemplo n.º 3
0
        }/*private void DeleteItemOnTill(int a_mealIndex, int a_itemIndex)*/

        /// <summary>
        /// Handles the composing of the void command for an Entree item. Parses the selected
        /// Entree's view and sends it to the KitchenScreenClient.
        /// </summary>
        /// <remarks>
        /// NAME: SendVoidCommandForEntree
        /// AUTHOR: Ryan Osgood
        /// DATE: 9/1/2019
        /// </remarks>
        /// <param name="a_mealIndex">The index of the meal of which exists the entree to void.</param>
        private void SendVoidCommandForEntree(int a_mealIndex)
        {
            Entree     targetEntree     = m_customerChecks[m_currentlySelectedTab].GetMealAtIndex(a_mealIndex).GetEntree();
            EntreeView targetEntreeView = new EntreeView(targetEntree);

            targetEntreeView.DecomposeAttributesToString();
            List <string> attributesOfVoid = new List <string>();

            foreach (string s in targetEntreeView.GetTextMods())
            {
                if (!s.Equals("") && !s.Equals("\r") && !s.Equals("~"))
                {
                    attributesOfVoid.Add(s + '\n');
                }
            }

            attributesOfVoid.Insert(0, m_customerChecks[m_currentlySelectedTab].Name + '\n');
            attributesOfVoid.Insert(1, m_customerChecks[m_currentlySelectedTab].GetCheckGUID() + '\n');
            attributesOfVoid.Insert(2, "VOID" + '\n');
            string toBeSent = string.Join(string.Empty, attributesOfVoid);

            m_server.SendToAll(toBeSent);
            UpdateDisplay();
        }/*private void SendVoidCommandForEntree(int a_mealIndex)*/