コード例 #1
0
    protected void CiaContab_DropDownList_SelectedIndexChanged(object sender, EventArgs e)
    {
        // para llenar el 2do. ddl en base a la selección del 1ro.

        SqlDataSource dsc  = (SqlDataSource)MontosRestringidos_FormView.FindControl("Cuentas_SqlDataSource");
        DropDownList  ddl1 = (DropDownList)MontosRestringidos_FormView.FindControl("CiasContab_DropDownList");
        DropDownList  ddl2 = (DropDownList)MontosRestringidos_FormView.FindControl("Cuentas_DropDownList");

        dsc.SelectParameters["Cia"].DefaultValue = ddl1.SelectedValue;
        ddl2.DataBind();
    }
コード例 #2
0
    protected void MontosRestringidos_Lista_ListView_SelectedIndexChanged(object sender, EventArgs e)
    {
        ListView MyListView = (ListView)sender;

        if (MyListView.SelectedIndex == -1)
        {
            return;
        }

        DataKey MyDataKey = MyListView.DataKeys[MyListView.SelectedIndex];

        MontosRestringidos_SqlDataSource.SelectParameters["ID"].DefaultValue = MyDataKey["ID"].ToString();

        //MontosRestringidos_SqlDataSource.SelectParameters["CiaContab"].DefaultValue = MyDataKey["CiaContab"].ToString();
        //MontosRestringidos_SqlDataSource.SelectParameters["Moneda"].DefaultValue = MyDataKey["Moneda"].ToString();
        //MontosRestringidos_SqlDataSource.SelectParameters["CuentaBancaria"].DefaultValue = MyDataKey["CuentaBancaria"].ToString();

        MontosRestringidos_FormView.DataBind();
        TabContainer1.ActiveTabIndex = 1;
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!User.Identity.IsAuthenticated)
        {
            FormsAuthentication.SignOut();
            return;
        }

        ErrMessage_Span.InnerHtml        = "";
        ErrMessage_Span.Style["display"] = "none";

        Master.Page.Title = "Consulta de disponibilidad - registro de montos restringidos";

        // -----------------------------------------------------------------------------------------

        if (!Page.IsPostBack)
        {
            //Gets a reference to a Label control that is not in a
            //ContentPlaceHolder control

            HtmlContainerControl MyHtmlSpan;

            MyHtmlSpan = (HtmlContainerControl)(Master.FindControl("AppName_Span"));
            if (MyHtmlSpan != null)
            {
                MyHtmlSpan.InnerHtml = "Bancos";
            }

            HtmlGenericControl MyHtmlH2;

            MyHtmlH2 = (HtmlGenericControl)(Master.FindControl("PageTitle_TableCell"));
            if (MyHtmlH2 != null)
            {
                MyHtmlH2.InnerHtml = "Consulta de disponibilidad - registro de montos restringidos";
            }

            //--------------------------------------------------------------------------------------------
            //para asignar la página que corresponde al help de la página

            HtmlAnchor MyHtmlHyperLink;
            MyHtmlHyperLink = (HtmlAnchor)Master.FindControl("Help_HyperLink");

            MyHtmlHyperLink.HRef = "javascript:PopupWin('../../../Doc/Bancos/Facturas/Consulta facturas/consulta_general_de_facturas.htm', 1000, 680)";

            // para que el ListView no regrese rows cuando se abre la página
            Session["FiltroForma"] = "1 = 2";
            RefreshAndBindInfo();
        }
        else
        {
            //-------------------------------------------------------------------------
            // la página puede ser 'refrescada' por el popup; en ese caso, ejeucutamos
            // una función que efectúa alguna funcionalidad y rebind la información

            if (this.RebindFlagHiddenField.Value == "1")
            {
                RebindFlagHiddenField.Value = "0";
                RefreshAndBindInfo();

                // para refrescar el FormView (y que no muestre un registro)
                MontosRestringidos_SqlDataSource.SelectParameters["ID"].DefaultValue = "-999";

                MontosRestringidos_FormView.DataBind();

                // para deseleccionar algún registro que esté seleccionado en la lista
                MontosRestringidos_Lista_ListView.SelectedIndex = -1;
            }
            else
            {
                // aparentemente, el SqlSelectCommand del SqlDataSource debe ser refrescado cada vez

                MontosRestringidos_Lista_SqlDataSource.SelectCommand = MontosRestringidos_Lista_SqlDataSource.SelectCommand + " Where " + Session["FiltroForma"].ToString();
            }
            // -------------------------------------------------------------------------
        }
    }