private void Limpiar()
        {
            TxtRut.Clear();
            TxtNombre.Clear();
            TxtApellidoPaterno.Clear();
            TxtApellidoMaterno.Clear();
            TxtBuscar.Clear();
            TxtId.Clear();
            TxtDireccion.Clear();
            TxtTelefono.Clear();
            TxtEmail.Clear();
            TxtImagen.Clear();


            BtnInsertar.Visible   = true;
            BtnActualizar.Visible = false;
            ErrorIcono.Clear();
            TxtImagen.Clear();
            PicImagen.Image  = null;
            this.RutaDestino = "";
            this.RutaOrigen  = "";

            DgvListado.Columns[0].Visible = false;
            BtnActivar.Visible            = false;
            BtnDesactivar.Visible         = false;
            BtnEliminar.Visible           = false;
            ChkSeleccionar.Checked        = false;
        }
 private void TxtNombres_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 13)
     {
         TxtDireccion.Focus();
     }
 }
        private void BtnModificar_Click(object sender, EventArgs e)
        {
            if (TxtCodigo.Text != "" && TxtNombre.Text != "" && TxtApellido.Text != "" && TxtClave.Text != "" && TxtDireccion.Text != "" && CmbEstado.Text != "")
            {
                ClsEEmpleados Eobj = new ClsEEmpleados();
                ClsNEmpleados Nobj = new ClsNEmpleados();
                Eobj.codemp = TxtCodigo.Text;
                Eobj.nomemp = TxtNombre.Text;
                Eobj.apeemp = TxtApellido.Text;
                Eobj.claemp = TxtClave.Text;
                Eobj.diremp = TxtDireccion.Text;
                Eobj.estado = CmbEstado.Text;
                Nobj.MtdActualizarEmpleados(Eobj);
                DgvEmpleados.DataSource = Nobj.MtdListarEmpleados();

                CmbEstado.Enabled = false;
                TxtCodigo.Enabled = true;
                TxtCodigo.Clear();
                TxtNombre.Clear();
                TxtApellido.Clear();
                TxtClave.Clear();
                TxtDireccion.Clear();
                CmbEstado.Text = "Activo";
            }
            else
            {
                MessageBox.Show("Por favor llene todos los campos", "Mensaje");
            }
        }
Exemple #4
0
 public void LimpiarTextBox()
 {
     TxtId.Clear();
     TxtNombre.Clear();
     TxtDireccion.Clear();
     TxtDui.Clear();
 }
Exemple #5
0
        private void GrabarCabecera()
        {
            if (Session.Count == 0)
            {
                LblMensaje.Text = "Debe Acceder Cuenta con su Usuario y Contraseña";
                return;
            }
            if (TxtFechaReg.Text.Trim() == "")
            {
                LblMensaje.Text = "Ingrese Fecha de Pedido";
                TxtFechaReg.Focus();
                return;
            }
            if (TxtFormaPago.Text.Trim() == "")
            {
                LblMensaje.Text = "Ingrese Forma de Pago";
                TxtFormaPago.Focus();
                return;
            }
            if (TxtFormaEnvio.Text.Trim() == "")
            {
                LblMensaje.Text = "Ingrese Forma de Envio";
                TxtFormaEnvio.Focus();
                return;
            }
            if (TxtDireccion.Text.Trim() == "")
            {
                LblMensaje.Text = "Ingrese Dirección";
                TxtDireccion.Focus();
                return;
            }
            if (TxtTelefono.Text.Trim() == "")
            {
                LblMensaje.Text = "Ingrese Teléfono";
                TxtTelefono.Focus();
                return;
            }
            try
            {
                Ent.Idpedido   = int.Parse(0 + TxtIdPedido.Text);
                Ent.Idusuario  = int.Parse(0 + Session["IdUsuario"].ToString());
                Ent.FechaReg   = Convert.ToDateTime(TxtFechaReg.Text);
                Ent.Formapago  = TxtFormaPago.Text.Trim();
                Ent.Formaenvio = TxtFormaEnvio.Text.Trim();
                Ent.Direccion  = TxtDireccion.Text.Trim();
                Ent.Telefono   = TxtTelefono.Text.Trim();

                int filas;
                filas = NegPedidos.GrabarPedido(Ent);
                if (filas > 0)
                {
                    TxtIdPedido.Text = Convert.ToString(filas);
                    LblMensaje.Text  = "Pedido Registrado";
                }
            }
            catch (Exception ex)
            {
                LblMensaje.Text = ex.Message;
            }
        }
 private void BtnAlta_Click(object sender, EventArgs e)
 {
     try
     {
         if (TxtCc.Text != "" && TxtNombre.Text != "" && TxtDireccion.Text != "" && TxtCorreo.Text != "" && DtpFecha.Text != "" && TxtTelefono.Text != "" && PbCliente.ImageLocation != null)
         {
             Cliente cliente = new Cliente();
             cliente.Guardar(TxtCc.Text, TxtNombre.Text, TxtDireccion.Text, TxtCorreo.Text, DtpFecha.Text, TxtTelefono.Text, PbCliente.ImageLocation);
             MessageBox.Show("Datos Guardados Correctamente");
             TxtCc.Clear();
             TxtNombre.Clear();
             TxtDireccion.Clear();
             TxtCorreo.Clear();
             TxtTelefono.Clear();
             PbCliente.ImageLocation = null;
         }
         else
         {
             if (PbCliente.ImageLocation != null)
             {
                 MessageBox.Show("Todos los Campos deben ser llenados para poder dar de alta un cliente");
             }
             else
             {
                 MessageBox.Show("Todos los Campos deben ser llenados para poder dar de alta un cliente y La imagen debe ser cargada");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error: " + ex);
     }
 }
Exemple #7
0
 private void Clear()//Método para limpiar
 {
     TxtOrden.Clear();
     TxtOrden.Enabled = true;
     TxtCc.Clear();
     TxtNombre.Clear();
     TxtDireccion.Clear();
     TxtTelefono.Clear();
     TxtObservaciones.Clear();
     TxtTotal.Clear();
     TxtFactura.Clear();
     CbxEstado.SelectedItem = (null);
     DateVencimiento.ResetText();
     DateVencimiento.Enabled    = true;
     CbxEstado.Enabled          = true;
     GridViewFactura.DataSource = null;
     TxtIva.Clear();
     TxtImpuesto.Clear();
     TxtDescuento.Clear();
     txtSubtotal.Clear();
     cbmPago.SelectedItem = null;
     CkbActivo.Visible    = false;
     BtnBuscar.Visible    = true;
     MostrarCodigo();
     TxtOrden.Focus();
 }
Exemple #8
0
 private void BtnEliminar_Click(object sender, EventArgs e)
 {
     try
     {
         const string eliminar = "DELETE FROM Vendedores WHERE IdVendedor=@Id";
         var          cmd      = new OleDbCommand(eliminar, Cnx)
         {
             CommandType = CommandType.Text
         };
         cmd.Parameters.AddWithValue("@Id", TxtId.Text);
         Cnx.Open();
         cmd.ExecuteNonQuery();
         Cnx.Close();
         MessageBox.Show(@"El Contacto Fue Eliminado....");
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, null, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     TxtId.Clear();
     TxtNombre.Clear();
     TxtFechaAlta.Clear();
     TxtNIF.Clear();
     TxtFechaNac.Clear();
     TxtDireccion.Clear();
     TxtPoblacion.Clear();
     TxtTelefono.Clear();
     TxtEstadoCivil.Clear();
     pictureBox1.ImageLocation = "";
     TxtId.Focus();
 }
 public void Clear()//METODO lIMPIAR
 {
     TxtCc.Clear();
     TxtPnombre.Clear();
     TxtSnombre.Clear();
     TxtPapellido.Clear();
     TxtSapellido.Clear();
     TxtTelefono.Clear();
     TxtCelular.Clear();
     TxtDireccion.Clear();
     TxtEmail.Clear();
     CmbSexo.SelectedItem = (null);
     DateNacimiento.ResetText();
     DateIngreso.ResetText();
     DateRetiro.ResetText();
     DateRetiro.Enabled = false;
     ChekFecha.Checked  = false;
     TxtObservaciones.Clear();
     CmbDisponibilidad.SelectedItem = (null);
     txtCargo.Clear();
     cbxContrato.Text = "";
     txtSalario.Clear();
     txtEps.Clear();
     txtCompensaciones.Clear();
     txtPensiones.Clear();
     txtARP.Clear();
     CkbActivo.Checked = true;
     TxtCc.Focus();
     BtnGuardar.Enabled   = true;
     BtnModificar.Enabled = false;
     Habilitar();
     TxtCc.Focus();
 }
        private void BtnBaja_Click(object sender, EventArgs e)
        {
            String  Cla     = TxtCc.Text;
            Cliente cliente = new Armeria.Cliente();

            if (cliente.bajaCliente(Cla, 1))
            {
                MessageBox.Show("Dato dado de Baja Corretamente");
            }
            else
            {
                MessageBox.Show("Dato dado de Baja Corretamente");
            }


            TxtCc.Clear();
            TxtNombre.Clear();
            TxtDireccion.Clear();
            TxtCorreo.Clear();
            TxtTelefono.Clear();
            PbCliente.ImageLocation = null;
            //ArchivoTexto archivotexto = new ArchivoTexto();
            //archivotexto.Leer(1);
            //ArchivoBinario archivobinario = new ArchivoBinario();
            //archivobinario.Leer(1);
        }
 /// <summary>
 /// Limpia los campos dónde se van a introducir datos.
 /// </summary>
 private void LimpiarCampos()
 {
     TxtNombre.Clear();
     TxtApellidos.Clear();
     TxtNif.Clear();
     TxtDireccion.Clear();;
     TxtTelefono.Clear();
 }
Exemple #12
0
 private void ClearData()
 {
     TxtNombre.Clear();
     TxtApellido.Clear();
     TxtDireccion.Clear();
     TxtTelefono.Clear();
     TxtTelfonoT.Clear();
 }
 public void LimpiarCajitas()
 {
     TxtCodigo.Clear();
     TxtNombre.Clear();
     TxtDireccion.Clear();
     TxtRuc.Clear();
     TxtTelefono.Clear();
     TxtEmail.Clear();
 }
 public void LimpiarCajitas()
 {
     TxtDni.Clear();
     TxtNombre.Clear();
     TxtApellido.Clear();
     TxtDireccion.Clear();
     TxtEmail.Clear();
     TxtTelefono.Clear();
 }
Exemple #15
0
        void guardarPersona()
        {
            try
            {
                string genero = string.Empty;
                if (RadioSexoM.Checked)
                {
                    genero = "Masculino";
                }
                else
                {
                    genero = "Femenino";
                }

                string tipoPersona = string.Empty;
                if (RadioButton1.Checked)
                {
                    tipoPersona = "1";
                }
                else if (RadioButton2.Checked)
                {
                    tipoPersona = "2";
                }
                else if (RadioButton3.Checked)
                {
                    tipoPersona = "3";
                }

                using (SqlConnection sqlCon = new SqlConnection(connectionString))
                {
                    sqlCon.Open();
                    string     query  = "INSERT INTO persona (tipo_persona_id,nombre,cedula,edad,sexo,telefono,direccion) VALUES (@tipo_persona_id,@nombre,@cedula,@edad,@sexo,@telefono,@direccion)";
                    SqlCommand sqlCmd = new SqlCommand(query, sqlCon);
                    sqlCmd.Parameters.AddWithValue("@tipo_persona_id", tipoPersona);
                    sqlCmd.Parameters.AddWithValue("@nombre", (TxtNombre.FindControl("TxtNombre") as TextBox).Text.Trim());
                    sqlCmd.Parameters.AddWithValue("@cedula", (TxtCedula.FindControl("TxtCedula") as TextBox).Text.Trim());
                    sqlCmd.Parameters.AddWithValue("@edad", (TxtEdad.FindControl("TxtEdad") as TextBox).Text.Trim());
                    sqlCmd.Parameters.AddWithValue("@sexo", genero);
                    sqlCmd.Parameters.AddWithValue("@telefono", (TxTtelefono.FindControl("TxTtelefono") as TextBox).Text.Trim());
                    sqlCmd.Parameters.AddWithValue("@direccion", (TxtDireccion.FindControl("TxtDireccion") as TextBox).Text.Trim());
                    sqlCmd.ExecuteNonQuery();

                    lblSuccessMessage.Text    = "Registro Con Exito";
                    lblSuccessMessage.Visible = true;
                    lblErrorMessage.Text      = "";
                    lblErrorMessage.Visible   = true;

                    sqlCmd.Parameters.Clear();
                }
            }
            catch (Exception ex)
            {
                lblSuccessMessage.Text = "";
                lblErrorMessage.Text   = ex.Message;
            }
        }
 private void BtnNuevo_Click(object sender, EventArgs e)
 {
     CmbEstado.Enabled = false;
     TxtCodigo.Enabled = true;
     TxtCodigo.Clear();
     TxtNombre.Clear();
     TxtApellido.Clear();
     TxtClave.Clear();
     TxtDireccion.Clear();
     CmbEstado.Text = "Activo";
 }
 public bool ValidarGuardar()
 {
     if (TxtNumeroIdentificacion.Text == "")
     {
         TxtNumeroIdentificacion.Focus();
         return(false);
     }
     else
     {
         if (TxtNombreCorto.Text == "")
         {
             TxtNombreCorto.Focus();
             return(false);
         }
         else
         {
             if (TxtDireccion.Text == "")
             {
                 TxtDireccion.Focus();
                 return(false);
             }
             else
             {
                 if (CboIdentificacion.SelectedIndex < 0)
                 {
                     CboIdentificacion.Focus();
                     return(false);
                 }
                 else
                 {
                     if (CboIdentificacion.SelectedIndex < 0)
                     {
                         CboIdentificacion.Focus();
                         return(false);
                     }
                     else
                     {
                         if (TxtTelefono.Text == "")
                         {
                             TxtTelefono.Focus();
                             return(false);
                         }
                         else
                         {
                             return(true);
                         }
                     }
                 }
             }
         }
     }
 }
Exemple #18
0
 public void Limpiar()
 {
     TxtDocumento.Clear();
     TxtNombres.Clear();
     TxtNombreContacto.Clear();
     TxtTelContacto.Clear();
     TxtApellidos.Clear();
     TxtCelular.Clear();
     TxtCorreo.Clear();
     TxtDireccion.Clear();
     TxtFijo.Clear();
     TxtTelContacto.Clear();
 }
 void LimpiarCamos()
 {
     txtId.Clear();
     TxtEmpresa.Clear();
     TxtNit.Clear();
     TxtDireccion.Clear();
     TxtCorreo.Clear();
     txtRepresentante.Clear();
     pbLogo.Image          = null;
     BtnAgregar.Enabled    = true;
     BtnActualizar.Enabled = false;
     BtnEliminar.Enabled   = false;
 }
Exemple #20
0
        private void LimpiarRegistros()
        {
            NombreEmpresa = null;
            TxtNombreEmpresa.Clear();
            RazonSocial = null;
            TxtRazonSocial.Clear();
            Direccion = null;
            TxtDireccion.Clear();
            Id_Impuesto = 0;
            CmbImpuesto.SelectedValue = 0;
            Id_Moneda = 0;
            CmbMoneda.SelectedValue = 0;
            RdbSI.Checked           = false;
            RdbNO.Checked           = false;
            Trabaja_Impuesto        = null;
            ChkCodigoBarras.Checked = false;
            Modo_Busqueda           = null;
            ChkTeclado.Checked      = false;
            Carpeta_Copia_Seguridad = null;
            TxtRutaCopiaSeguridad.Clear();
            Correo_EnvioReportes = null;
            TxtCorreoEmpresa.Clear();
            Ultima_Fecha_Copia_Seguridad = null;
            Ultima_Fecha_Copia_Date      = DateTime.Now;
            Frecuencia_Copias            = 0;
            Id_Estatus     = 0;
            Tipo_Empresa   = null;
            Redondeo_Total = null;

            PctbxLogo.Image = Properties.Resources.LgoEsferaBlancTrasp;

            Calle = null;
            TxtCalle.Clear();
            Numero_Interno = null;
            TxtNumInterno.Clear();
            Numero_Externo = null;
            TxtNumExterno.Clear();
            Entre_Calles = null;
            TxtEntreCalles.Clear();
            Id_Colonia = 0;
            //CmbColonias.SelectedValue=0;
            Codigo_Postal = 0;
            TxtCodigoPostal.Clear();
            Id_Municipio = 0;
            //CmbxMunicipio.SelectedValue=0;
            Id_Estado = 0;
            //Convert.ToInt32(CmbxEstado.SelectedValue);
            Id_Pais = 0;
            CmbPais.SelectedValue = 0;
            Direccion             = null;
        }
 private void BtnActualizar_Click(object sender, EventArgs e)
 {
     try
     {
         Cliente cliente = new Cliente();
         if (TxtCc.Text != "" && TxtNombre.Text != "" && TxtDireccion.Text != "" && TxtCorreo.Text != "" && DtpFecha.Text != "" && TxtTelefono.Text != "" && PbCliente.ImageLocation != null)
         {
             String Cla   = TxtCc.Text;
             String datos = cliente.consultaCliente(Cla, 1);
             if (datos != null)
             {
                 string[] campos = datos.Split('|');
                 campos[0] = TxtCc.Text;
                 campos[1] = TxtNombre.Text;
                 campos[2] = TxtDireccion.Text;
                 campos[3] = TxtCorreo.Text;
                 campos[4] = DtpFecha.Text;
                 campos[5] = TxtTelefono.Text;
                 campos[6] = PbCliente.ImageLocation;
                 cliente.bajaCliente(Cla, 1);
                 cliente.Guardar(campos[0], campos[1], campos[2], campos[3], campos[4], campos[5], campos[6]);
                 MessageBox.Show("Datos Modificados Correctamente");
                 TxtCc.Clear();
                 TxtNombre.Clear();
                 TxtDireccion.Clear();
                 TxtCorreo.Clear();
                 TxtTelefono.Clear();
                 PbCliente.ImageLocation = null;
             }
             else
             {
                 MessageBox.Show("Dato no encontrado");
             }
         }
         else
         {
             if (PbCliente.ImageLocation != null)
             {
                 MessageBox.Show("Todos los Campos deben ser llenados para poder Modificar un cliente");
             }
             else
             {
                 MessageBox.Show("Todos los Campos deben ser llenados para poder Modificar un cliente y La imagen debe ser cargada");
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error: " + ex);
     }
 }
Exemple #22
0
 private void BtnLimpiar_Click_1(object sender, EventArgs e)
 {
     TxtId.Clear();
     TxtNombre.Clear();
     TxtFechaAlta.Clear();
     TxtNIF.Clear();
     TxtFechaNac.Clear();
     TxtDireccion.Clear();
     TxtPoblacion.Clear();
     TxtTelefono.Clear();
     TxtEstadoCivil.Clear();
     pictureBox1.ImageLocation = "";
     TxtId.Focus();
 }
 public void Limpiar()
 {
     TxtNombre1.Clear();
     TxtNombre2.Clear();
     TxtApellido1.Clear();
     TxtApellido2.Clear();
     TxtDireccion.Clear();
     TxtTelefono.Clear();
     PctHuella.Image         = null;
     PctFoto.Image           = null;
     Pt_Firma.Image          = null;
     TxtEdad.Text            = "";
     DtFechaNacimiento.Value = DateTime.Now.Date;
     ModoEdicion.Visible     = false;
 }
Exemple #24
0
        private void Limpiar()
        {
            TxtBuscar.Clear();
            TxtRut.Clear();
            TxtNombre.Clear();
            TxtDireccion.Clear();
            txtId.Clear();
            BtnInsertar.Visible   = true;
            BtnActualizar.Visible = false;
            ErrorIcono.Clear();

            DgvListado.Columns[0].Visible = false;
            BtnEliminar.Visible           = false;
            ChkSeleccionar.Checked        = false;
        }
Exemple #25
0
 private void BtnCancelar_Click_1(object sender, EventArgs e)
 {
     BtnContrato.Enabled   = false;
     BtnTrabajador.Enabled = false;
     TxtDireccion.Clear();
     txtEmail.Clear();
     TxtNit.Clear();
     TxtPaginaWeb.Clear();
     TxtRazonSocial.Clear();
     TxtRepresentante.Clear();
     TxtTelefono.Clear();
     TxtTelRepresentante.Clear();
     pbxFotografia.Image = null;
     DgvEmpresa.ClearSelection();
     TxtNit.Focus();
 }
Exemple #26
0
 protected void Func_LimpiarControles()
 {
     TxtIdentificacion.Clear();
     TxtNombres.Clear();
     TxtApellidos.Clear();
     CbxSexo.SelectedIndex   = 0;
     CbxEstado.SelectedIndex = 0;
     TxtDireccion.Clear();
     TxtCorreo.Clear();
     TxtTelefono.Clear();
     TxtUsuario.Clear();
     TxtMovil.Clear();
     LblUser.Text  = "";
     ruta_default  = Filename = Path.Combine(folder, "default.png");
     PtbFoto.Image = Image.FromFile(ruta_default);
     TxtIdentificacion.Focus();
 }
Exemple #27
0
 public void Clear()//MÉTODO LIMPIAR
 {
     TxtCc.Clear();
     TxtNombre.Clear();
     TxtTelefono.Clear();
     TxtExt.Clear();
     TxtCelular.Clear();
     TxtFax.Clear();
     TxtDireccion.Clear();
     TxtEmail.Clear();
     TxtObservaciones.Clear();
     TxtContacto.Clear();
     CkbActivo.Checked = true;
     Habilitar();
     BtnModificar.Enabled = false;
     BtnGuardar.Enabled   = true;
     TxtCc.Focus();
 }
Exemple #28
0
 private void Clear()//Método para limpiar
 {
     TxtRemision.Clear();
     TxtRemision.Enabled = true;
     TxtCc.Clear();
     TxtNombre.Clear();
     TxtDireccion.Clear();
     TxtTelefono.Clear();
     TxtObservaciones.Clear();
     TxtTotal.Clear();
     CbxEstado.SelectedItem = (null);
     txtSubtotal.Clear();
     txtIva.Clear();
     DateOrden.ResetText();
     cmbEmpleados.SelectedItem = (null);
     //cmbEmpleados.SelectedText = ("Seleccione...");
     GridViewOrden.DataSource = null;
     TxtRemision.Focus();
 }
Exemple #29
0
        /// <summary>
        /// Limpia los campos dónde se van a introducir datos.
        /// </summary>
        private void LimpiarCampos()
        {
            TxtNombre.Clear();
            TxtApellidos.Clear();
            TxtNif.Clear();
            TxtDireccion.Clear();;
            TxtTelefono.Clear();
            TxtObservaciones.Clear();

            TxtMarca.Clear();
            TxtModelo.Clear();
            TxtMatricula.Clear();
            TxtLlave.Clear();
            TxtPlaza.Clear();

            TxtBaseImponible.Clear();
            TxtIva.Clear();
            TxtTotal.Clear();
        }
Exemple #30
0
 private void BtnAgregar_Click(object sender, EventArgs e)
 {
     try
     {
         const string insertar = @"Insert Into Vendedores Values (@IdVendedor, @NombreVendedor,
         @FechaAlta, @NIF, @FechaNac,@Direccion,@Poblacion,@Telefono,@EstadoCivil,@Fotografia)";
         var          cmd      = new OleDbCommand(insertar, Cnx)
         {
             CommandType = CommandType.Text
         };
         cmd.Parameters.AddWithValue("@IdVendedor", TxtId.Text);
         cmd.Parameters.AddWithValue("@NombreVendedor", TxtNombre.Text);
         cmd.Parameters.AddWithValue("@FechaAlta", TxtFechaAlta.Text);
         cmd.Parameters.AddWithValue("@NIF", TxtNIF.Text);
         cmd.Parameters.AddWithValue("@FechaNac", TxtFechaNac.Text);
         cmd.Parameters.AddWithValue("@Direccion", TxtDireccion.Text);
         cmd.Parameters.AddWithValue("@Poblacion", TxtPoblacion.Text);
         cmd.Parameters.AddWithValue("@Telefono", TxtTelefono.Text);
         cmd.Parameters.AddWithValue("@EstadoCivil", TxtEstadoCivil.Text);
         pictureBox1.ImageLocation = StrFileName;
         cmd.Parameters.AddWithValue("@Fotografia", pictureBox1.ImageLocation);
         Cnx.Open();
         cmd.ExecuteNonQuery();
         Cnx.Close();
         MessageBox.Show(@"El Contacto Fue Registrado");
     }
     catch (Exception ex)
     {
         MessageBox.Show(@"La Clave a Registrar Ya Existe", ex.Message);
     }
     TxtId.Clear();
     TxtNombre.Clear();
     TxtFechaAlta.Clear();
     TxtNIF.Clear();
     TxtFechaNac.Clear();
     TxtDireccion.Clear();
     TxtPoblacion.Clear();
     TxtTelefono.Clear();
     TxtEstadoCivil.Clear();
     pictureBox1.ImageLocation = "";
     TxtId.Focus();
 }