Ejemplo n.º 1
0
        }/*private bool ValidateDeleteAction()*/

        /// <summary>
        /// Determines if the current delete action is a void or standard delete. A void is
        /// performed when the user wants to delete an item that has already been sent to
        /// the KitchenScreenClient.
        /// </summary>
        /// <remarks>
        /// NAME: DetermineIfVoidOrDelete
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/13/2019
        /// </remarks>
        /// <param name="a_mealIndex">The position of the meal within the meal list.</param>
        /// <returns>
        /// Returns true if the action is a void, false if standard delete.
        /// </returns>
        private bool DetermineIfVoidOrDelete(int a_mealIndex)
        {
            CustomerCheck currentlySelectedCheck = m_customerChecks.ElementAt(m_currentlySelectedTab);
            Meal          currentlySelectedMeal  = currentlySelectedCheck.GetMealAtIndex(a_mealIndex);

            return(currentlySelectedMeal.SentFlag);
        }/*private bool DetermineIfVoidOrDelete(int a_mealIndex)*/
Ejemplo n.º 2
0
        }/*public MainPoSForm(int a_enteredCode) : this()*/

        /// <summary>
        /// The Load event for the main register menu. This event is raised whenever the form is constructed
        /// This method sets up the menu for use: Generates the default check and its representative button,
        /// establishes connection with the database and sets the Listbox's datasource to the BindingList
        /// </summary>
        /// //<remarks>
        /// NAME: MainPoSForm_Load
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/13/2019
        /// </remarks>
        /// <param name="sender"> The object that the event is attached to </param>
        /// <param name="e"> The EventArgs of the raised event. </param>
        private void MainPoSForm_Load(object sender, EventArgs e)
        {
            Button defaultTabButton = new Button
            {
                Size     = new Size(m_buttonSizeX, m_buttonSizeY),
                Location = new Point(0, 10)
            };

            defaultTabButton.Click += BtnTabInfo_Click;
            defaultTabButton.Tag    = m_buttonID;
            m_buttonID++;

            flpTabs.Controls.Add(defaultTabButton);
            m_customerTabsButtons.Add(defaultTabButton);

            CustomerCheck defaultCustomerCheck = new CustomerCheck();

            m_customerChecks.Add(defaultCustomerCheck);
            m_customerCheckView = new CustomerCheckView(defaultCustomerCheck);

            InitializeDatabaseConnection();
            RecognizeEmployee();
            RecognizeEmployeeTitle();

            lbCustomerCheck.DataSource = m_customerCheckView.GetItemsForDisplay();
        }/*private void MainPoSForm_Load(object sender, EventArgs e)*/
Ejemplo n.º 3
0
        }/*private void MainPoSForm_Load(object sender, EventArgs e)*/

        /// <summary>
        /// This click event is raised whenever the user wants to create a new customer tab.
        /// A customer check object is created along with its representative button. Only
        /// allows up to 5 tabs max.
        /// </summary>
        /// <remarks>
        /// NAME: BtnNewTab_Click
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/13/2019
        /// </remarks>
        /// <param name="sender">The button that raised the event</param>
        /// <param name="e">The EventArgs of the raised event</param>
        private void BtnNewTab_Click(object sender, EventArgs e)
        {
            if (m_customerTabsButtons.Count < m_maximumTabCount)
            {
                m_buttonLocationFormatter += 45;

                Button newButton = new Button
                {
                    Size     = new Size(m_buttonSizeX, m_buttonSizeY),
                    Location = new Point(m_buttonLocationFormatter, 10)
                };

                newButton.Click       += BtnTabInfo_Click;
                newButton.AutoEllipsis = true;
                newButton.Tag          = m_buttonID;
                m_buttonID++;

                CustomerCheck newCheck = new CustomerCheck();
                m_customerChecks.Add(newCheck);

                m_customerTabsButtons.Add(newButton);
                flpTabs.Controls.Add(newButton);
            }
            else
            {
                MessageBox.Show(@"Maximum tab capacity reached.");
            }
        }/*private void BtnNewTab_Click(object sender, EventArgs e)*/
        }/*public void UpdateMembersForDisplay(CustomerCheck a_customerCheck)*/

        /// <summary>
        /// Clears all the members that are vital for display to ensure there are no garbage or
        /// leftover values from updating.
        /// </summary>
        /// <remarks>
        /// NAME: ClearMembersForReinitialization
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/16/2019
        /// </remarks>
        public void ClearMembersForReinitialization()
        {
            m_customerCheck = null;
            m_menuItemsForDisplay.Clear();
            m_customerMealViews.Clear();
            m_pricingOfOrders.Clear();
        }/*public void ClearMembersForReinitialization()*/
        }/*public CustomerCheckView(CustomerCheck a_customerOrders)*/

        /// <summary>
        /// Clears and re-initializes all members for updating.
        /// </summary>
        /// <remarks>
        /// NAME: UpdateMembersForDisplay
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/16/2019
        /// </remarks>
        /// <param name="a_customerCheck">The CustomerCheck that belongs to this CustomerCheckView</param>
        public void UpdateMembersForDisplay(CustomerCheck a_customerCheck)
        {
            ClearMembersForReinitialization();
            m_customerCheck = a_customerCheck;
            RefreshMealViews();
            RetrieveItemDetails();
            CompleteMealPricingForView();
        }/*public void UpdateMembersForDisplay(CustomerCheck a_customerCheck)*/
Ejemplo n.º 6
0
        }/*private void BtnSendOrdersOnTill_Click(object sender, EventArgs e)*/

        /// <summary>
        /// Flag all the items on the current tab as sent.
        /// </summary>
        /// <remarks>
        /// NAME: FlagMealsOnTillAsSent
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/13/2019
        /// </remarks>
        private void FlagMealsOnTillAsSent()
        {
            CustomerCheck currentlySelected = m_customerChecks[m_currentlySelectedTab];

            for (int i = 0; i < currentlySelected.NumberOfMeals(); i++)
            {
                Meal mealOnTill = currentlySelected.GetMealAtIndex(i);
                mealOnTill.SentFlag = true;
            }
        }/*private void FlagMealsOnTillAsSent()*/
Ejemplo n.º 7
0
        }/*private void InitializeDatabaseConnection()*/

        /// <summary>
        /// This event is raised whenever the user wants to add a check identifier to the tab.
        /// A keyboard form is constructed for input.
        /// </summary>
        /// <remarks>
        /// NAME: BtnSetCheckName_Click
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/13/2019
        /// </remarks>
        /// <param name="sender"> The button that raised the event</param>
        /// <param name="e">The EventArgs of the event</param>
        private void BtnSetCheckName_Click(object sender, EventArgs e)
        {
            Button selectedTab = m_customerTabsButtons[m_currentlySelectedTab];

            if (selectedTab.Text.Length > 0)
            {
                return;
            }
            CustomerCheck checkAtSelectedTab = m_customerChecks[m_currentlySelectedTab];

            KeyboardForm keyboardForm = new KeyboardForm(checkAtSelectedTab);

            keyboardForm.ShowDialog();
            selectedTab.Text = checkAtSelectedTab.Name;
        }/*private void BtnSetCheckName_Click(object sender, EventArgs e)*/
Ejemplo n.º 8
0
        } /*public KeyboardForm()*/

        /// <summary>
        /// A constructor for the KeyboardForm. Inherits from
        /// the default constructor and member CustomerCheck
        /// to the passed CustomerCheck.
        /// </summary>
        /// <remarks>
        /// NAME: KeyboardForm
        /// AUTHOR: Ryan Osgood
        /// DATE: 8/17/2019
        /// </remarks>
        /// <param name="a_check">The CustomerCheck in which is getting advanced identification.</param>
        public KeyboardForm(CustomerCheck a_check) : this()
        {
            m_checkToModify = a_check;
        } /*public KeyboardForm(CustomerCheck check) : this()*/
 /// <summary>
 /// A constructor for the CustomerCheckView. Sets
 /// its customer check and enables the BindingList events.
 /// </summary>
 /// <remarks>
 /// NAME: CustomerCheckView
 /// AUTHOR: Ryan Osgood
 /// DATE: 8/16/2019
 /// </remarks>
 /// <param name="a_customerOrders">The CustomerCheck that belongs to this CustomerCheckView.</param>
 public CustomerCheckView(CustomerCheck a_customerOrders)
 {
     m_customerCheck = a_customerOrders;
     m_menuItemsForDisplay.ListChanged += MenuItemsForDisplay_ListChanged;
 }/*public CustomerCheckView(CustomerCheck a_customerOrders)*/