Exemplo n.º 1
0
        public Plataforma getPlataforma(string id)
        {
            Plataforma cat   = new Plataforma();
            DataTable  tabla = ds.ObtenerTabla("Plataforma", "Select * from plataformas where Cod_Plataforma_P=" + id);

            cat.setCodigoPlataforma(tabla.Rows[0][0].ToString());
            cat.setNombrePlataforma(tabla.Rows[0][1].ToString());
            return(cat);
        }
Exemplo n.º 2
0
        protected void grdPlataformas_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            String s_codigoPlataforma = ((Label)grdPlataformas.Rows[e.RowIndex].FindControl("lbl_eit_codigoPlataforma")).Text.Trim();
            String s_nombrePlataforma = ((TextBox)grdPlataformas.Rows[e.RowIndex].FindControl("txt_eit_nombrePlataforma")).Text.Trim();



            Plataforma plat = new Plataforma();

            plat.setCodigoPlataforma(s_codigoPlataforma);
            plat.setNombrePlataforma(s_nombrePlataforma);

            N_Plataforma n_Plataforma = new N_Plataforma();

            n_Plataforma.ActualizarPlataforma(plat);

            grdPlataformas.EditIndex = -1;
            cargarGridview();
        }
Exemplo n.º 3
0
        protected void btnAgregar_Click(object sender, EventArgs e)
        {
            Plataforma   plataforma   = new Plataforma();
            N_Plataforma n_Plataforma = new N_Plataforma();

            string nombrePlataforma = TxtNombrePlataforma.Text.Trim();

            if (nombrePlataforma != "")
            {
                if (!n_Plataforma.getBuscarNombrePlataforma(nombrePlataforma))
                {
                    int ultimaPlataforma = n_Plataforma.getConsultaUltimaPlataforma() + 1;
                    plataforma.setCodigoPlataforma("PF" + ultimaPlataforma);
                    plataforma.setNombrePlataforma(nombrePlataforma);
                    n_Plataforma.AltaPlataforma(plataforma);
                    Response.Write("<script>alert('Plataforma agregada con exito');</script>");
                    TxtNombrePlataforma.Text = "";
                    grdPlataformas.EditIndex = -1;
                    cargarGridview();
                }
                else
                {
                    Response.Write("<script>alert('La plataforma ya existe');</script>");
                    TxtNombrePlataforma.Text = "";
                    grdPlataformas.EditIndex = -1;
                    cargarGridview();
                }
            }
            else
            {
                Response.Write("<script>alert('Debe ingresar una Plataforma');</script>");
                TxtNombrePlataforma.Text = "";
                grdPlataformas.EditIndex = -1;
                cargarGridview();
            }
        }