protected void GDVenda_RowDeleting(object sender, GridViewDeleteEventArgs e) { Class_Venda vend = new Class_Venda(); vend.codvenda = int.Parse(e.Values[0].ToString()); vend.deletar(); GDVenda.EditIndex = -1; GDVenda.DataSource = vend.visualizar(); GDVenda.DataBind(); }
protected void Deletar_Click(object sender, EventArgs e) { try { Class_Venda vend = new Class_Venda(); vend.codvenda = int.Parse(txtCodigoVenda.Text); vend.deletar(); GDVenda.DataSource = vend.visualizar(); GDVenda.DataBind(); } catch (Exception ex) { Response.Write(ex.Message); } }