Beispiel #1
0
        protected void btnEliminarCheque_Click(object sender, ImageClickEventArgs e)
        {
            ImageButton objBoton = sender as ImageButton;

            foreach (GridViewRow objFila in gvChequesIngresados.Rows)
            {
                if (objBoton.Equals(objFila.FindControl("btnEliminarCheque") as ImageButton))
                {
                    string strIdCheque = objBoton.CommandArgument;

                    DataTable table = Consulta.VALIDAREliminarChequeMCH(strIdCheque);
                    if (table != null && table.Rows.Count > 0)
                    {
                        MostrarMensaje("documento est\x00e1 Liberado y Rendido, no se puede eliminar");
                    }
                    else
                    {
                        Transaccion.EliminarChequeMCH(strIdCheque);
                        CargaAbonosRealizados();
                        MostrarMensaje("cheque eliminado correctamente");
                    }
                    break;
                }
            }
        }
Beispiel #2
0
        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>");
                }
            }
        }