Exemple #1
0
        private void TableIcon_MouseClick(object sender, EventArgs e)
        {
            try
            {
                COrderManager tempOrderManager = new COrderManager();
                LobbyItemButton tempTableIcon = (LobbyItemButton)sender;
                CCommonConstants tempCommonConstants = ConfigManager.GetConfig<CCommonConstants>();

                if (tempTableIcon.Type.Equals("Table") || tempTableIcon.Type.Equals("Tabs"))
                {
                    if (m_bTableInfoClicked)
                    {
                        CTableInfoMessageBox tempTableInfoMessageBox = new CTableInfoMessageBox(tempTableIcon.OrderID);
                        tempTableInfoMessageBox.Show();

                        m_bTableInfoClicked = false;
                        return;
                    }
                    else if (m_bNameTableClicked)
                    {
                        CKeyBoardForm tempKeyBoardForm = new CKeyBoardForm("Table Naming", "Please Enter the Name of the Table");
                        tempKeyBoardForm.ShowDialog();

                        if (CKeyBoardForm.Content.Equals("Cancel") || CKeyBoardForm.Content.Equals(""))
                            return;

                        COrderInfo tempOrderInfo = (COrderInfo)tempOrderManager.OrderInfoByOrderID(tempTableIcon.OrderID).Data;
                        tempOrderInfo.TableName = CKeyBoardForm.Content;
                        tempOrderManager.UpdateOrderInfo(tempOrderInfo);
                        tempTableIcon.TableName = CKeyBoardForm.Content;
                        m_bNameTableClicked = false;
                        TablePanel.Controls.Clear();
                        this.Init();
                        return;
                    }
                    else if (m_bChangeDetailsClicked)
                    {
                        CKeyBoardForm tempKeyBoardForm = new CKeyBoardForm("Change Details", "Please Enter the Name of the Table");
                        tempKeyBoardForm.ShowDialog();
                        if (CKeyBoardForm.Content.Equals("Cancel")) //If cancelled then exit.
                        {
                            return;
                        }

                        CCalculatorForm tempCalculatorForm = new CCalculatorForm("Change Details", "Guest Quantity");
                        tempCalculatorForm.ShowDialog();

                        COrderInfo tempOrderInfo = (COrderInfo)tempOrderManager.OrderInfoByOrderID(tempTableIcon.OrderID).Data;
                        if (!CKeyBoardForm.Content.Equals("") && !CKeyBoardForm.Content.Equals("Cancel"))
                        {
                            tempOrderInfo.TableName = CKeyBoardForm.Content;
                        }

                        if(!CCalculatorForm.inputResult.Equals("") && !CCalculatorForm.inputResult.Equals("Cancel") && !(Int32.Parse(CCalculatorForm.inputResult)==0))
                            tempOrderInfo.GuestCount = Convert.ToInt32(CCalculatorForm.inputResult);
                        tempOrderManager.UpdateOrderInfo(tempOrderInfo);

                        m_bChangeDetailsClicked = false;
                        TablePanel.Controls.Clear();
                        Init();
                        return;
                    }
                }

                CTableInfo tempTableInfo = new CTableInfo();
                tempTableInfo = (CTableInfo)tempOrderManager.GetTableInfoByTableNumber(tempTableIcon.TableNumber, tempTableIcon.Type).Data;

                if (tempTableInfo!=null && tempTableInfo.Status == 1)
                {
                    CMessageBox tempMessageBox = new CMessageBox("Table Information", "Someone else is using this table at this moment.");
                    tempMessageBox.ShowDialog();
                    return;
                }

                tempTableInfo.TableNumber = tempTableIcon.TableNumber;
                tempTableInfo.TableType = tempTableIcon.Type;
                tempTableInfo.Status = 1;
                tempOrderManager.UpdateTableInfo(tempTableInfo);

                if (tempTableIcon.Type.Equals("Table"))
                {
                    CTableOrderForm tempTableOrderForm = new CTableOrderForm(tempTableIcon.OrderID, tempCommonConstants.TableType, tempTableIcon.TableNumber);
                    tempTableOrderForm.m_TerminalName = TerminalIDLabel.Text;
                    tempTableOrderForm.m_orderUserName = tempTableIcon.User;
                    tempTableOrderForm.Show();
                }
                else if (tempTableIcon.Type.Equals("Tabs"))
                {
                    CBarServiceForm tempBarServiceForm = new CBarServiceForm(tempTableIcon.OrderID, tempCommonConstants.TabsType, tempTableIcon.TableNumber);
                    tempBarServiceForm.Show();

                }
                else if (tempTableIcon.Type.Equals("TakeAway"))
                {
                    CTableOrderForm tempTableOrderForm = new CTableOrderForm(tempTableIcon.OrderID, tempCommonConstants.TakeAwayType, tempTableIcon.TableNumber);
                    //tempTableOrderForm.m_TerminalName = TerminalIDLabel.Text;
                    tempTableOrderForm.m_orderUserName = tempTableIcon.User;
                    tempTableOrderForm.Show();
                }

                CFormManager.Forms.Push(this);
                this.Hide();
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.ToString());
            }
        }
Exemple #2
0
        private void BarServiceButton_Click(object sender, EventArgs e)
        {
            CBarServiceForm tempBarServiceForm = null;
            try
            {
                 tempBarServiceForm = new CBarServiceForm();
                 tempBarServiceForm.Show();

                CFormManager.Forms.Push(this);
                this.Hide();
            }
            catch (ArgumentException exp)
            {
                Console.Write(exp.Message);
            }
            catch (Exception exp)
            {
                Console.Write(exp.Message);
            }
        }