예제 #1
0
        protected void RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            // actualizar programa
            GridViewRow fila = Tabla_programas.Rows[e.RowIndex];

            int id_programa_aux = Convert.ToInt32(Tabla_programas.DataKeys[e.RowIndex].Values[0]);



            String nombre_aux = (fila.FindControl("nombre_programa") as TextBox).Text.ToUpper();


            controlador_programa = new ProgramaController(id_programa_aux, nombre_aux, "");

            if (controlador_programa.actualizar_programa())
            {
                Tabla_programas.EditIndex = -1;
                BindGridView();
                ClientScript.RegisterStartupScript(this.GetType(), "mensaje", "<script> swal({position: 'center',type: 'success',title: 'Actulizacion Correcta!',showConfirmButton: false,timer: 2500}) </script>");
            }
            else
            {
                ClientScript.RegisterStartupScript(this.GetType(), "mensaje", "<script> swal({type: 'error',title: 'Programa No! Actualizado',text: 'Algo salió mal!',timer: 3200}) </script>");
            }
        }
예제 #2
0
        protected void actualizar_Click(object sender, EventArgs e)
        {
            // hacer un update en la tabla usuario..
            controlador_usuario = new UsuarioController(aux_fk_usuario, txt_correo.Text, "", "");
            int    aux_fk_programa;
            String aux_programa = "";
            int    aux_semestre = 0;

            // actualizar usuario
            if (controlador_usuario.actualizar_usuario())
            {
                controlador_jugador = new JugadorController(0, 0, "", "", "", "", "", 0, "", "", aux_fk_usuario);

                aux_fk_programa = controlador_jugador.fk_programa();

                if (this.lista_programas.SelectedItem.Text.Equals(" -- Seleccione una Carrera -- "))
                {
                    aux_programa = this.txt_carrera_actual.Text;
                }
                else
                {
                    aux_programa = this.lista_programas.SelectedValue;
                }

                if (lista_semestres.SelectedItem.Text.Equals(" -- Seleccione un Semestre -- "))
                {
                    aux_semestre = Convert.ToInt32(txt_semestre_actual.Text);
                }
                else
                {
                    aux_semestre = Convert.ToInt32(lista_semestres.SelectedValue);
                }



                controlador_programa = new ProgramaController(aux_fk_programa, aux_programa, "");
                // actualizar programa
                if (controlador_programa.actualizar_programa())
                {
                    // actualizar jugador
                    controlador_jugador = new JugadorController(0, Convert.ToInt32(txt_identificacion.Text), txt_nombre1.Text, txt_nombre2.Text, txt_apellido1.Text, txt_apellido2.Text, "", aux_semestre, txt_correo.Text, "", aux_fk_usuario);

                    if (controlador_jugador.actualizar_jugador())
                    {
                        // actualizado
                        ClientScript.RegisterStartupScript(this.GetType(), "mensaje", "<script> swal({position: 'center',type: 'success',title: 'Actulizacion Correcta',timer: 2500}) </script>");
                    }
                }
            }
        }