Exemplo n.º 1
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int fila      = Convert.ToInt32(e.CommandArgument);
            int idfamilia = Convert.ToInt32(grvfamilia.Rows[fila].Cells[0].Text);

            if (e.CommandName == "Modificar")
            {
                Response.Redirect("~/ModFamilia.aspx?IDF=" + idfamilia, true);
            }
            else if (e.CommandName == "Ver")
            {
                Response.Redirect("VerFamilia.aspx?IDF=" + idfamilia, true);
            }
            else if (e.CommandName == "Eliminar")
            {
                FamiliaDAO db = new FamiliaDAO();
                db.Eliminar(idfamilia);
                cargar();
                string script = "openModal();";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", script, true);
            }
        }