Ejemplo n.º 1
0
        protected void btn_Excluir_Click(object sender, EventArgs e)
        {
            try
            {
                Class_Venda venda = new Class_Venda();
                venda.codvenda = int.Parse(txtcod_venda.Text);

                venda.deletar();
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
Ejemplo n.º 2
0
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            try
            {
                Class_Venda venda = new Class_Venda();
                venda.codvenda = int.Parse(e.Values[0].ToString());
                venda.deletar();

                GridView1.EditIndex  = -1;
                GridView1.DataSource = venda.visualizar();
                GridView1.DataBind();
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }