Exemple #1
0
        private void mnuUnregisterRestaurant_Click(object sender, EventArgs e)
        {
            DialogResult button =
                MessageBox.Show(
                    "Are you sure you want to delete the entire restaurant layout?",
                    "Confirm Layout Delete",
                    MessageBoxButtons.YesNo,
                    MessageBoxIcon.Question,
                    MessageBoxDefaultButton.Button2);

            if (button == DialogResult.Yes)
            {
                ReservationDA.DeleteAllReservations();
                TableDA.DeleteAllTables();
                BarSeatDA.DeleteAllBarSeats();
                BarTableDA.DeleteBarTable();
                ServerDA.DeleteAllServers();
                RestaurantDA.DeleteRestaurant();

                NoCurrentRestaurant();

                if (mnuRegisterRestaurant.Enabled == false)
                {
                    mnuRegisterRestaurant.Enabled = true;
                }

                MessageBox.Show("Restaurant has been unregistered!", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemple #2
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;
        }