Beispiel #1
0
        public void LoadBarSeats()
        {
            List <BarSeat> oBarSeats = BarSeatDA.GetBarSeatLayout();

            if (!(Utility.IsNullOrEmpty(oBarSeats)))
            {
                foreach (BarSeat oBarSeat in oBarSeats)
                {
                    RoundButton button = new RoundButton();
                    button.Cursor    = Cursors.Hand;
                    button.Height    = 30;
                    button.Width     = 30;
                    button.FlatStyle = FlatStyle.Flat;
                    button.FlatAppearance.BorderSize = 0;
                    if (oBarSeat.TableState == TableState.Empty.ToString())
                    {
                        button.BackColor = Color.Cyan;
                    }
                    else if (oBarSeat.TableState == TableState.Occupied.ToString())
                    {
                        button.BackColor = Color.Red;
                    }
                    else if (oBarSeat.TableState == TableState.Bussable.ToString())
                    {
                        button.BackColor = Color.Yellow;
                    }
                    button.Tag      = oBarSeat;
                    button.Text     = "B" + Convert.ToString(oBarSeat.TableNumber);
                    button.Location = new Point(oBarSeat.TablePositionX, oBarSeat.TablePositionY);
                    button.Click   += new EventHandler(btnBarSeatClick);
                    pnlRoom.Controls.Add(button);
                }
            }
        }
Beispiel #2
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!";
        }