Example #1
0
 private void botonOcupar(object sender, EventArgs e)
 {
     if (buttonOcupar.Text.Equals("Ocupar"))
     {
         if (comboBox1.Text == "")
         {
             Mensaje.mensajeError("no se puede ocupar una mesa si no se define un mozo");
         }
         else
         {
             conexion.ocuparMesa(item, padre.plantilla, true, padre.turno);
             buttonOcupar.Text     = "Desocupar";
             buttonAgregar.Enabled = true;
             labelLLego.Text       = DateTime.Now.ToLongTimeString();
             llego            = DateTime.Now;
             labelActual.Text = (DateTime.Now - llego).ToString();
             timer1.Start();
             conexion.EditarIngreso(DateTime.Now, item, padre.plantilla);
         }
     }
     else
     {
         conexion.ocuparMesa(item, padre.plantilla, false, padre.turno);
         buttonOcupar.Text = "Ocupar";
         conexion.agregarSalida(item, padre.plantilla);
         conexion.quitarPedidos(this);
         timer1.Stop();
         buttonAgregar.Enabled = false;
     }
     refrescarTabla();
 }
Example #2
0
        private void aceptar_Click(object sender, EventArgs e)
        {
            //string nombre = textBoxNombre.Text;
            //string precio = textBoxPrecio.Text;
            //bool sinTacc = checkBoxSinTACC.Checked;
            //bool vegetariano = checkBoxVegetariano.Checked;



            if (!hayCamposVacios())
            {
                if (esFloat(textBoxPrecio.Text))
                {
                    string nombre      = textBoxNombre.Text;
                    bool   vegetariano = checkBoxVegetariano.Checked;
                    bool   sinTACC     = checkBoxSinTACC.Checked;
                    string precio      = textBoxPrecio.Text;

                    Conexion.editarComida(id, nombre, precio, sinTACC, vegetariano);
                    Mensaje.mensajeError("se agrego con exito");
                    vaciarCampos();
                    menu.RecargarTabla();
                }
                else
                {
                    Mensaje.mensajeError("El precio ingresado debe ser flotante");
                }
            }
            else
            {
                Mensaje.mensajeError("hay campos vacios");
            }
        }
Example #3
0
        private void buttonOcupar_Click(object sender, EventArgs e)
        {
            if (!hayCamposVacios())
            {
                if (esFloat(textBoxPrecio.Text))
                {
                    string nombre      = textBoxNombre.Text;
                    bool   vegetariano = checkBoxVegetariano.Checked;
                    bool   sinTACC     = checkBoxSinTACC.Checked;
                    float  precio      = float.Parse(textBoxPrecio.Text);

                    Conexion.AgregarComida(nombre, vegetariano, sinTACC, precio);
                    Mensaje.mensajeError("se agrego con exito");
                    vaciarCampos();
                    menu.RecargarTabla();
                }
                else
                {
                    Mensaje.mensajeError("El precio ingresado debe ser flotante");
                }
            }
            else
            {
                Mensaje.mensajeError("hay campos vacios");
            }
        }
        private void buttonAgregar_Click(object sender, EventArgs e)
        {
            string nombre        = textBoxNombre.Text;
            bool   estaALaMañana = checkBoxMañana.Checked;
            bool   estaALaTarde  = checkBoxTarde.Checked;
            bool   estaALaNoche  = checkBoxNoche.Checked;

            if (nombre.Any())
            {
                if (TieneTurno())
                {
                    Conexion.agregarMozo(nombre, estaALaMañana, estaALaTarde, estaALaNoche);
                    vaciarCampos();
                    padre.recargarTabla();
                    Mensaje.mensajeError("se agrego con exito");
                }
                else
                {
                    Mensaje.mensajeError("El mozo no tiene un turno asignado");
                }
            }
            else
            {
                Mensaje.mensajeError("El mozo no tiene nombre");
            }
        }
Example #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            String alto  = textBoxAlto.Text;
            String ancho = textBoxAncho.Text;

            if (esInt(alto))
            {
                if (esInt(ancho))
                {
                    if (estanEnRango(ancho))
                    {
                        if (estanEnRango(alto))
                        {
                            conexion.guardarMedidas(ancho, alto, plantilla);
                            this.Close();
                        }
                        else
                        {
                            Mensaje.mensajeError("el alto debe ser entero menor a 100 y mayor a 8");
                        }
                    }
                    else
                    {
                        Mensaje.mensajeError("el ancho debe ser entero menor a 100 y mayor a 8");
                    }
                }
                else
                {
                    Mensaje.mensajeError("el ancho debe ser entero menor a 100 y mayor a 8");
                }
            }
            else
            {
                Mensaje.mensajeError("el alto debe ser entero menor a 100 y mayor a 8");
            }
        }
Example #6
0
 private void prubaKey_KeyPress(object sender, KeyPressEventArgs e)
 {
     Mensaje.mensajeError("aaaaa");
 }