Exemplo n.º 1
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "buttonUpdate")
            {
                /*Button Update*/
                int crow;
                crow = Convert.ToInt32(e.CommandArgument.ToString());
                string email = GridView1.Rows[crow].Cells[3].Text;
                TextBoxEmailU.Text = email;
                fillData(email);
                ClientScript.RegisterStartupScript(this.GetType(), "key", "showModaUpdate()", true);
            }

            if (e.CommandName == "buttonDelete")
            {
                try
                {
                    /*Button Delete*/
                    int crow;
                    crow = Convert.ToInt32(e.CommandArgument.ToString());
                    string typeUser = GridView1.Rows[crow].Cells[2].Text;
                    string email    = GridView1.Rows[crow].Cells[3].Text;
                    bll.deleteParty(email);
                    alert("Eliminado " + email);
                    load();
                } catch (Exception ex) {
                    alert("El Usuario no puede ser elimina ya que se utiliza en otro lugar de la aplicacion");
                }
            }
        }