Example #1
0
        private void cmbIdentificacion_SelectedIndexChanged(object sender, EventArgs e)
        {
            try {
                int IdU = Convert.ToInt32(cmbIdentificacion.SelectedItem); //esto sirva !! dato selecciona pasar a int
                                                                           //llenar los controles
                DataTable          oDT   = new DataTable();
                UsuariosDelSistema oInfo = new UsuariosDelSistema();
                oDT = oInfo.Cargar_InfoUsuario(IdU);

                //validar al arreglar lo anterior que se llene el txt con el nombre traido de la BD
            } catch (Exception) { }
        }
Example #2
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            DataTable oDT;

            oDT = Principal.oDT;

            Usuarios oUsuario = new Usuarios();

            oUsuario.prop_apellido1 = txtApellido1.Text;
            oUsuario.prop_apellido2 = txtApellido2.Text;
            oUsuario.prop_Canton    = (cmbCanton.SelectedIndex) + 1;
            if (txtPassword.Text == txtConfirmarPass.Text)
            {
                oUsuario.prop_contraseƱa = txtConfirmarPass.Text;
            }
            oUsuario.prop_direccionExacta = rtExacta.Text;
            oUsuario.prop_Distrito        = (cmbDistrito.SelectedIndex) + 1;
            oUsuario.prop_email           = txtEmail.Text;
            oUsuario.prop_tipoEmail       = (cmbTipoEmail.SelectedIndex) + 1;
            if (txtEmail2.Text != null)
            {
                oUsuario.prop_tipoEmail2 = (cmbEmail2.SelectedIndex) + 1;
                oUsuario.prop_email2     = txtEmail2.Text;
            }
            oUsuario.prop_fechaNacimientoa = dtpFechaNacimiento.Text;
            oUsuario.prop_id            = txtIdentificacion.Text;
            oUsuario.prop_idGenero      = (cmbGenero.SelectedIndex) + 1;
            oUsuario.prop_nombre        = txtNombre.Text;
            oUsuario.prop_nombreUsuario = txtUser.Text;
            oUsuario.prop_Provincia     = (cmbProvincia.SelectedIndex) + 1;
            oUsuario.prop_telefono      = Convert.ToInt32(txtTelefono.Text);
            oUsuario.prop_telefono2     = Convert.ToInt32(txtTel2.Text);
            oUsuario.prop_tipoPersona   = (cmbTipoPersona.SelectedIndex) + 1;
            oUsuario.prop_tipoTelefono  = (cmbTipoTelefono.SelectedIndex) + 1;
            oUsuario.prop_tipoTelefono2 = (cmbTel2.SelectedIndex) + 1;
            oUsuario.prop_tipoUsuario   = (cmbTipoUsuario.SelectedIndex) + 1;

            oUsuario.prop_idPersonaCreadora = Convert.ToInt32(oDT.Rows[0]["idPersona"]);
            oUsuario.prop_idTipoTransac     = 2;

            UsuariosDelSistema objUsuSist = new UsuariosDelSistema();

            objUsuSist.Insertar_Usuario(oUsuario);

            cmbCanton.Text         = "";
            cmbDistrito.Text       = "";
            cmbEmail2.Text         = "";
            cmbGenero.Text         = "";
            cmbProvincia.Text      = "";
            cmbTel2.Text           = "";
            cmbTipoEmail.Text      = "";
            cmbTipoPersona.Text    = "";
            cmbTipoTelefono.Text   = "";
            cmbTipoUsuario.Text    = "";
            txtApellido1.Text      = "";
            txtApellido2.Text      = "";
            txtConfirmarPass.Text  = "";
            txtEmail.Text          = "";
            txtEmail2.Text         = "";
            txtIdentificacion.Text = "";
            txtNombre.Text         = "";
            txtPassword.Text       = "";
            txtTel2.Text           = "";
            txtTelefono.Text       = "";
            txtUser.Text           = "";
            rtExacta.Text          = "";
        }