Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Cuentas cuenta = new Cuentas();
                CuentaOrigenDropDownList.DataSource     = cuenta.Listado(" * ", "1=1", "");
                CuentaOrigenDropDownList.DataTextField  = "Descripcion";
                CuentaOrigenDropDownList.DataValueField = "CuentaId";
                CuentaOrigenDropDownList.DataBind();

                CuentaDestinoDropDownList.DataSource     = cuenta.Listado(" * ", "CuentaId <> " + CuentaOrigenDropDownList.SelectedValue, "");
                CuentaDestinoDropDownList.DataTextField  = "Descripcion";
                CuentaDestinoDropDownList.DataValueField = "CuentaId";
                CuentaDestinoDropDownList.DataBind();
                int            id;
                Transferencias tran = new Transferencias();
                if (Request.QueryString["id"] != null)
                {
                    int.TryParse(Request.QueryString["id"].ToString(), out id);

                    if (id > 0)
                    {
                        if (!tran.Buscar(id))
                        {
                            Utilitarios.ShowToastr(this.Page, "Registro no encontrado.", "Error", "Error");
                            Limpiar();
                        }
                        else
                        {
                            Llenar(tran);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected void CuentaOrigenDropDownList_SelectedIndexChanged(object sender, EventArgs e)
        {
            Cuentas cuenta = new Cuentas();

            CuentaDestinoDropDownList.DataSource     = cuenta.Listado(" * ", "CuentaId <> " + CuentaOrigenDropDownList.SelectedValue, "");
            CuentaDestinoDropDownList.DataTextField  = "Descripcion";
            CuentaDestinoDropDownList.DataValueField = "CuentaId";
            CuentaDestinoDropDownList.DataBind();
        }