protected void Borrar(object sender, GridViewCommandEventArgs e) { string str; string str4; this.gridViewRow = ((Control)e.CommandSource).BindingContainer as GridViewRow; if (e.CommandName.CompareTo("Estado") == 0) { string str3 = "N"; str = e.CommandName.ToString(); string text = ((Label)this.gridViewRow.FindControl("lblnrodoc444")).Text; if ((this.gridViewRow.FindControl("lblHonorarios3") as Label).Text == "N") { str3 = "S"; } Transaccion.CambiaEstadoChequeMCH(text, str3); str4 = "pagoAbonoSub.aspx?Codigo=" + this.hiddidcobranza.Value.ToString(); this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('cheque cambiado de estado correctamente');location.href='" + str4.ToString() + "';</script>"); } if (e.CommandName.CompareTo("Borrar") == 0) { str = e.CommandName.ToString(); string str5 = ((Label)this.gridViewRow.FindControl("lblnrodoc444")).Text; DataTable table = Consulta.VALIDAREliminarChequeMCH(str5); if ((table.Rows.Count > 0) && (table != null)) { this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('documento est\x00e1 Liberado y Rendido, no se puede eliminar');</script>"); } else { Transaccion.EliminarChequeMCH(str5); str4 = "pagoAbonoSub.aspx?Codigo=" + this.hiddidcobranza.Value.ToString(); this.Page.RegisterClientScriptBlock("Mensaje", "<script>alert('cheque eliminado correctamente');location.href='" + str4.ToString() + "';</script>"); } } }