private void botonAtras_Click(object sender, EventArgs e)
        {
            FormTerraza terraza = new FormTerraza();

            terraza.Show();
            this.Hide();
        }
示例#2
0
        /// <summary>
        /// Botón para acceder a la terraza
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BotonTerraza_Click_1(object sender, EventArgs e)
        {
            FormTerraza terraza = new FormTerraza();

            terraza.Show();
            this.Hide();
        }
        private void BotonMarchar_Click(object sender, EventArgs e)
        {
            FormTerraza terraza = new FormTerraza();

            terraza.Show();
            this.Hide();

            cont = 0;
        }
        private void BtnCobrarTarjeta_Click(object sender, EventArgs e)
        {
            if (Properties.Settings.Default.CajaAbierta == true)
            {
                Properties.Settings.Default.DineroTarjeta += float.Parse(val_total.Text);
                Properties.Settings.Default.Save();

                total = 0;
                panel3.Controls.Clear();
            }
            else
            {
                MessageBox.Show("Tienes que abrir la caja para poder cobrar");
            }

            MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder();

            builder.Server   = "localhost";
            builder.UserID   = "root";
            builder.Password = "";
            builder.Database = "restaurante";
            MySqlConnection conn  = new MySqlConnection(builder.ToString());
            MySqlCommand    query = conn.CreateCommand();

            try
            {
                conn.Open();
                query.CommandText = String.Format("delete from productosmesa where numMesa = '{0}' and tipo='{1}' ", LabelMesa.Text, "t");
                query             = new MySql.Data.MySqlClient.MySqlCommand(query.CommandText, conn);
                query.ExecuteNonQuery();

                total = 0;
                panel3.Controls.Clear();
                val_total.Text = "0";
                conn.Close();
            }
            catch (MySqlException exception)
            {
                MessageBox.Show(exception.Message);
            }

            FormTerraza terraza = new FormTerraza();

            terraza.Show();
            this.Hide();
        }