Example #1
0
 void ActualizarUsuario()
 {
     if (txtNombreUno.Text.Length == 0 || txtCedula.Text.Length == 0 || txtNombreDos.Text.Length == 0 ||
         txtApellidoM.Text.Length == 0 || txtApellidoP.Text.Length == 0 || txtClave.Text.Length == 0 ||
         txtConfirmacionClave.Text.Length == 0 || txtEmail.Text.Length == 0 || ddlRol.SelectedIndex == -1)
     {
         lblMensaje.Text = "Datos incompletos, porfavor complete todos los campos del formulario";
     }
     else
     {
         if (!txtClave.Text.Equals(txtConfirmacionClave.Text))
         {
             lblMensaje.Text = "Las contraseñas no coincide";
         }
         else
         {
             UsuarioEntity usuar = new UsuarioEntity();
             usuar.Cedula    = txtCedula.Text;
             usuar.Nombres   = txtNombreUno.Text + " " + txtNombreDos.Text;
             usuar.Apellidos = txtApellidoP.Text + " " + txtApellidoM.Text;
             usuar.Clave     = txtClave.Text;
             usuar.Correo    = txtEmail.Text;
             usuar.Tipo      = id.ToString();
             ManejoDatos mn  = new ManejoDatos();
             bool        res = mn.actualizarDatosUsuario(usuar);
             if (res == true)
             {
                 lblMensaje.Text = "Usuario actualizado con exito";
             }
             else
             {
                 lblMensaje.Text = "No se pudo actualizar al usuario";
             }
         }
     }
 }