Example #1
0
        private void TxtLegajo_KeyPress_1(object sender, KeyPressEventArgs e)
        {
            if ((char)Keys.Enter == e.KeyChar)
            {
                if (string.IsNullOrEmpty(txtLegajo.Text))
                {
                    MessageBox.Show("Por favor ingrese un legajo valido");
                    return;
                }

                var mozo = _empleadoServicio.ObtenerPorLegajo(txtLegajo.Text);

                if (mozo != null)
                {
                    if (mozo.EstaEliminado)
                    {
                        MessageBox.Show("El mozo seleccionado se encuentra eliminado");
                    }
                    else
                    {
                        var mesa = _comprobanteSalonServicio.ObtenerPorId(_mesaId);
                        _comprobanteSalonServicio.ModificarMozo(_mesaId, mozo);

                        txtMozo.Text = mozo.ApyNom;

                        txtCodigo.Enabled = true;
                        txtCodigo.Focus();
                    }
                }
                else
                {
                    MessageBox.Show("No se encontro el mozo");
                }
            }
        }