Exemple #1
0
        public void DeleteLayout()
        {
            tables = TableDA.GetTableLayout();

            if (Utility.IsNullOrEmpty(tables))
            {
                MessageBox.Show("Error: Layout was not Successfully Deleted", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                TableDA.DeleteAllTables();
                BarTableDA.DeleteBarTable();
                BarSeatDA.DeleteAllBarSeats();
                lblMessage.Text = "Restaurant layout was successfully deleted.";
            }

            ResetLayout();
            //btnSaveLayout.Enabled = true;
        }
Exemple #2
0
        public void LoadTables()
        {
            List <Table> oTables = TableDA.GetTableLayout();

            if (!(Utility.IsNullOrEmpty(oTables)))
            {
                foreach (Table oTable in oTables)
                {
                    RoundButton button = new RoundButton();
                    button.Cursor    = Cursors.Hand;
                    button.Height    = 50;
                    button.Width     = 50;
                    button.FlatStyle = FlatStyle.Flat;
                    button.FlatAppearance.BorderSize = 0;
                    if (oTable.TableState == TableState.Empty.ToString())
                    {
                        button.BackColor = Color.Cyan;
                    }
                    else if (oTable.TableState == TableState.Occupied.ToString())
                    {
                        button.BackColor = Color.Red;
                    }
                    else if (oTable.TableState == TableState.Bussable.ToString())
                    {
                        button.BackColor = Color.Yellow;
                    }
                    button.Tag  = oTable.TableNumber;
                    button.Text = Convert.ToString(oTable.TableNumber)
                                  + "\n" + Convert.ToString(oTable.NumberOfSeats) + " seats";
                    //button.Text = "#"+Convert.ToString(oTable.TableNumber)
                    //    + "\nSeats " + Convert.ToString(oTable.NumberOfSeats);
                    button.Location = new Point(oTable.TablePositionX, oTable.TablePositionY);
                    button.Click   += new EventHandler(btnSeatClick);
                    pnlRoom.Controls.Add(button);
                }
            }
        }
Exemple #3
0
        public void LoadTables()
        {
            // Load Tables
            tables = TableDA.GetTableLayout();

            if (!(Utility.IsNullOrEmpty(tables)))
            {
                foreach (Table eachTable in tables)
                {
                    table = eachTable;

                    RoundButton button = new RoundButton();
                    button.Cursor    = Cursors.Hand;
                    button.Height    = 50;
                    button.Width     = 50;
                    button.FlatStyle = FlatStyle.Flat;
                    button.FlatAppearance.BorderSize = 0;
                    button.BackColor = Color.Cyan;
                    button.Tag       = table;
                    button.Text      = Convert.ToString(table.TableNumber)
                                       + "\n" + Convert.ToString(table.NumberOfSeats) + " seats";
                    button.Location = new Point(table.TablePositionX, table.TablePositionY);
                    pnlRoom.Controls.Add(button);

                    button.MouseDown += button_MouseDown;
                    button.MouseUp   += button_MouseUp;
                    button.MouseMove += button_MouseMove;
                }

                txtTableNumber.Text = Convert.ToString(Table.TotalTables);
            }

            //Load BarSeats.
            barSeats = BarSeatDA.GetBarSeatLayout();

            if (!(Utility.IsNullOrEmpty(barSeats)))
            {
                foreach (BarSeat eachBarSeat in barSeats)
                {
                    barSeat = eachBarSeat;

                    RoundButton button = new RoundButton();
                    button.Cursor    = Cursors.Hand;
                    button.Height    = 30;
                    button.Width     = 30;
                    button.FlatStyle = FlatStyle.Flat;
                    button.FlatAppearance.BorderSize = 0;
                    button.BackColor = Color.Cyan;
                    button.Tag       = barSeat;
                    button.Text      = "B" + Convert.ToString(barSeat.TableNumber);
                    button.Location  = new Point(barSeat.TablePositionX, barSeat.TablePositionY);
                    pnlRoom.Controls.Add(button);

                    button.MouseDown += button_MouseDown;
                    button.MouseUp   += button_MouseUp;
                    button.MouseMove += button_MouseMove;
                }

                txtBarSeatNumber.Text = Convert.ToString(BarSeat.TotalTables);
            }

            // Load BarTable.
            barTable = BarTableDA.GetBarTableLayout();

            if (barTable != null)
            {
                StayInsideButton button = new StayInsideButton();
                button.Cursor    = Cursors.Hand;
                button.Height    = 30;
                button.Width     = 200;
                button.FlatStyle = FlatStyle.Flat;
                button.FlatAppearance.BorderSize = 0;
                button.BackColor = Color.Cyan;
                button.Tag       = barTable;
                button.Text      = "Bar";
                button.Location  = new Point(barTable.TablePositionX, barTable.TablePositionY);
                pnlRoom.Controls.Add(button);

                button.MouseDown += button_MouseDown;
                button.MouseUp   += button_MouseUp;
                button.MouseMove += button_MouseMove;
            }

            lblMessage.Text = "Seating layout successfully loaded!";
        }