Пример #1
0
        public override void Inicializador(long?entidadId)
        {
            if (entidadId.HasValue)
            {
                return;
            }

            CargarComboBox(cmbProvincia,
                           _provinciaServicio.ObtenerParaCmb(string.Empty),
                           "Descripcion",
                           "Id");

            if (cmbProvincia.Items.Count > 0)
            {
                var provincia = (ProvinciaDto)cmbProvincia.Items[0];

                CargarComboBox(cmbLocalidad,
                               _localidadServicio.ObtenerPorProvincia(provincia.Id,
                                                                      string.Empty),
                               "Descripcion",
                               "Id");
            }

            nudLegajo.Minimum = 1;
            nudLegajo.Maximum = 99999999;
            nudLegajo.Value   = _empleadoServicio.ObtenerSiguienteLegajo();

            // Asignando un Evento
            txtApellido.KeyPress     += Validacion.NoNumeros;
            txtApellido.KeyPress     += Validacion.NoSimbolos;
            txtNombre.KeyPress       += Validacion.NoNumeros;
            txtNombre.KeyPress       += Validacion.NoSimbolos;
            txtDni.KeyPress          += Validacion.NoLetras;
            txtDni.KeyPress          += Validacion.NoSimbolos;
            txtCuil.KeyPress         += Validacion.NoLetras;
            txtCuil.KeyPress         += Validacion.NoSimbolos;
            txtTelefono.KeyPress     += Validacion.NoLetras;
            txtTelefono.KeyPress     += Validacion.NoSimbolos;
            txtCelular.KeyPress      += Validacion.NoLetras;
            txtCelular.KeyPress      += Validacion.NoSimbolos;
            txtCalle.KeyPress        += Validacion.NoNumeros;
            txtCalle.KeyPress        += Validacion.NoSimbolos;
            txtNumero.KeyPress       += Validacion.NoLetras;
            txtNumero.KeyPress       += Validacion.NoSimbolos;
            txtPiso.KeyPress         += Validacion.NoLetras;
            txtPiso.KeyPress         += Validacion.NoSimbolos;
            txtDepartamento.KeyPress += Validacion.NoSimbolos;
            txtManzana.KeyPress      += Validacion.NoSimbolos;
            txtLote.KeyPress         += Validacion.NoSimbolos;
            txtCasa.KeyPress         += Validacion.NoSimbolos;

            imgFotoEmpleado.Image = Constantes.Imagen.Usuario;

            txtApellido.Focus();
        }
        public override void Inicializador(long?entidadId)
        {
            if (entidadId.HasValue)
            {
                return;
            }

            CargarComboBox(cmbProvincia, _provinciaServicio.ObtenerParaCmb(string.Empty), "Descripcion", "Id");

            if (cmbProvincia.Items.Count > 0)
            {
                var provincia = (ProvinciaDto)cmbProvincia.Items[0];

                CargarComboBox(cmbLocalidad, _localidadServicio.ObtenerPorProvincia(provincia.Id, string.Empty), "Descripcion", "Id");
            }


            txtApellido.KeyPress        += Validacion.NoNumeros;
            txtApellido.KeyPress        += Validacion.NoSimbolos;
            txtNombre.KeyPress          += Validacion.NoNumeros;
            txtNombre.KeyPress          += Validacion.NoSimbolos;
            txtDni.KeyPress             += Validacion.NoLetras;
            txtDni.KeyPress             += Validacion.NoSimbolos;
            txtCuil.KeyPress            += Validacion.NoLetras;
            txtCuil.KeyPress            += Validacion.NoSimbolos;
            txtTelefono.KeyPress        += Validacion.NoLetras;
            txtTelefono.KeyPress        += Validacion.NoSimbolos;
            txtCelular.KeyPress         += Validacion.NoLetras;
            txtCelular.KeyPress         += Validacion.NoSimbolos;
            txtCalle.KeyPress           += Validacion.NoNumeros;
            txtCalle.KeyPress           += Validacion.NoSimbolos;
            txtNumero.KeyPress          += Validacion.NoLetras;
            txtNumero.KeyPress          += Validacion.NoSimbolos;
            txtPiso.KeyPress            += Validacion.NoLetras;
            txtPiso.KeyPress            += Validacion.NoSimbolos;
            txtDepartamento.KeyPress    += Validacion.NoSimbolos;
            txtManzana.KeyPress         += Validacion.NoSimbolos;
            txtLote.KeyPress            += Validacion.NoSimbolos;
            txtCasa.KeyPress            += Validacion.NoSimbolos;
            nudCuentaCorriente.KeyPress += Validacion.NoSimbolos;

            lblCuentacorriente.Enabled = false;
            nudCuentaCorriente.Enabled = false;

            CheckCuentaCorriente.Checked = false;

            txtApellido.Focus();
        }