Esempio n. 1
0
        protected void Habilitar(object sender, GridViewCommandEventArgs e)
        {
            this.gridViewRow = ((Control)e.CommandSource).BindingContainer as GridViewRow;
            if (e.CommandName.CompareTo("Habilitar") == 0)
            {
                string str  = e.CommandName.ToString();
                string text = ((Label)this.gridViewRow.FindControl("lblCodigo")).Text;
                if (!string.IsNullOrEmpty(text))
                {
                    string[] strArray = text.Split(new char[] { '|' });
                    string   str3     = strArray[0].ToString();
                    string   str4     = strArray[1].ToString();
                    string   str5     = strArray[2].ToString();
                    switch (str4)
                    {
                    case "P":
                        ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "Mensaje", "alert('Letra Cancelada');", true);
                        this.getDocumentosPagar(this.hiddidcobranza.Value.ToString());
                        break;

                    case "J":
                        if (str5 == "3")
                        {
                            Transaccion.ActualizaPagoDocuJuicio(str3);
                            ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "Mensaje", "alert('Letra Cancelada');", true);
                            this.getDocumentosPagar(this.hiddidcobranza.Value.ToString());
                        }
                        if (str5 == "2")
                        {
                            Transaccion.ActualizaPagoDocuPagare(str3);
                            ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "Mensaje", "alert('Letra Cancelada');", true);
                            this.getDocumentosPagar(this.hiddidcobranza.Value.ToString());
                        }
                        if (str5 == "1")
                        {
                            Transaccion.ActualizaPagoDocuMutuo(str3);
                            ScriptManager.RegisterStartupScript(this.Page, base.GetType(), "Mensaje", "alert('Letra Cancelada');", true);
                            this.getDocumentosPagar(this.hiddidcobranza.Value.ToString());
                        }
                        break;
                    }
                }
            }
            string str6 = "Abonos.aspx?Codigo=" + this.hiddidcobranza.Value.ToString();

            this.Page.RegisterClientScriptBlock("Mensaje", "<script>location.href='" + str6.ToString() + "';</script>");
        }