コード例 #1
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            if (admMesas.RegresaTamaño() >= 10)
            {
                MessageBox.Show("NUMERO MAXIMO DE MESAS", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                if (ValidarDescripcion())
                {
                    string desc        = cmbDescripcion.SelectedItem.ToString();
                    int    numPersonas = Convert.ToInt32(numUpNumPer.Value.ToString());

                    admMesas.AgregaMesas(desc, numPersonas);
                    MessageBox.Show("Mesa Agregada Con Exito", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    if (admMesas.RegresaTamaño() <= 9)
                    {
                        txtNumMesa.Text = Mesa.RetornaNumMesa().ToString();
                    }
                    //limpia
                    cmbDescripcion.SelectedIndex = -1;
                    numUpNumPer.Value            = 1;
                    cmbDescripcion.Focus();
                }
            }
        }
コード例 #2
0
 public frmAltaMesas(AdministraMesa aMesas)
 {
     InitializeComponent();
     admMesas        = aMesas;
     txtNumMesa.Text = Mesa.RetornaNumMesa().ToString();
 }