Exemple #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);
                        }
                    }
                }
            }
        }
        protected void BuscarButton_Click(object sender, EventArgs e)
        {
            Cuentas   cuenta    = new Cuentas();
            DataTable dataTable = new DataTable();
            string    condicion;

            if (ConsultaDropDownList.SelectedIndex == 0)
            {
                if (DatosTextBox.Text.Trim().Length == 0)
                {
                    condicion = "1=1";
                }
                else
                {
                    condicion = "CuentaId = " + DatosTextBox.Text;
                }
                dataTable = cuenta.Listado(" CuentaId, Descripcion, Balance", condicion, "");
                ConsultaGridView.DataSource = dataTable;
                ConsultaGridView.DataBind();
            }
            if (ConsultaDropDownList.SelectedIndex == 1)
            {
                if (DatosTextBox.Text.Trim().Length == 0)
                {
                    condicion = "2=2";
                }
                else
                {
                    condicion = string.Format("Descripcion = '{0}' ", DatosTextBox.Text);
                }
                dataTable = cuenta.Listado(" CuentaId, Descripcion, Balance", condicion, "");
                ConsultaGridView.DataSource = dataTable;
                ConsultaGridView.DataBind();
            }
            if (ConsultaDropDownList.SelectedIndex == 2)
            {
                if (DatosTextBox.Text.Trim().Length == 0)
                {
                    condicion = "3=3";
                }
                else
                {
                    condicion = string.Format("Balance = {0}", DatosTextBox.Text);
                }
                dataTable = cuenta.Listado(" CuentaId, Descripcion, Balance", condicion, "");
                ConsultaGridView.DataSource = dataTable;
                ConsultaGridView.DataBind();
            }
        }
        private void TransferenciasForm_Load(object sender, EventArgs e)
        {
            DataTable dato, dato1;

            dato  = cuentas.Listado("CuentaId,Descripcion,Balance", "0=0", "ORDER BY CuentaId");
            dato1 = cuentas.Listado("CuentaId,Descripcion,Balance", "0=0", "ORDER BY CuentaId");

            comboBoxCuentaOrigen.DataSource    = dato;
            comboBoxCuentaOrigen.ValueMember   = "CuentaId";
            comboBoxCuentaOrigen.DisplayMember = "Descripcion";

            comboBoxCuentaDestino.DataSource    = dato1;
            comboBoxCuentaDestino.ValueMember   = "CuentaId";
            comboBoxCuentaDestino.DisplayMember = "Descripcion";
        }
Exemple #4
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();
        }
        private void CuentaIdcomboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataTable data = new DataTable();

            data = cuenta.Listado("CuentaId,Nombre", "0=0", "ORDER BY CuentaId");
            CuentaIdcomboBox.DataSource    = data;
            CuentaIdcomboBox.ValueMember   = "CuentaId";
            CuentaIdcomboBox.DisplayMember = "Descripcion";
        }
Exemple #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Cuentas   c      = new Cuentas();
            DataTable dt     = new DataTable();
            string    filtro = "1=1";

            CuentasGridView.DataSource = c.Listado(" * ", filtro, "");
            CuentasGridView.DataBind();
        }
        //Esto es para llenar el combobox con Las CuentaId de la tabla Cuenta
        private void CuantasxCobrarForm_Load(object sender, EventArgs e)
        {
            DataTable datos = new DataTable();

            datos = cuentas.Listado("CuentaId,Descripcion", "0=0", "ORDER BY CuentaId");
            ComboBoxCuentaId.DataSource = datos;

            ComboBoxCuentaId.ValueMember   = "CuentaId";
            ComboBoxCuentaId.DisplayMember = "Descripcion";
        }
Exemple #8
0
        private void BuscarButton_Click(object sender, EventArgs e)
        {
            Cuentas cuenta = new Cuentas();
            string  filtro = "1=1";

            if (FiltrotextBox.Text.Length > 0)
            {
                filtro = CamposcomboBox.Text + " like '%" + FiltrotextBox.Text + "%'";
            }

            ConsultadataGridView.DataSource = cuenta.Listado("CuentaId,Descripcion,Balance", filtro, "");

            ConteotextBox.Text = ConsultadataGridView.RowCount.ToString();
        }
Exemple #9
0
        public void LlenarDropDownList()
        {
            Cuentas      cuenta     = new Cuentas();
            TiposEgresos tipoEgreso = new TiposEgresos();
            Miembros     miembro    = new Miembros();

            CuentaIdDropDownList.DataSource     = cuenta.Listado(" * ", "1=1", "");
            CuentaIdDropDownList.DataTextField  = "Descripcion";
            CuentaIdDropDownList.DataValueField = "CuentaId";
            CuentaIdDropDownList.DataBind();

            TipoEgresoIdDropDownList.DataSource     = tipoEgreso.Listado(" * ", "1=1", "");
            TipoEgresoIdDropDownList.DataTextField  = "Descripcion";
            TipoEgresoIdDropDownList.DataValueField = "TipoEgresoId";
            TipoEgresoIdDropDownList.DataBind();

            MiembroIdDropDownList.DataSource     = miembro.Listado(" * ", "1=1", "");
            MiembroIdDropDownList.DataTextField  = "Nombre";
            MiembroIdDropDownList.DataValueField = "MiembroId";
            MiembroIdDropDownList.DataBind();
        }
Exemple #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                FechaTexBox.Text = DateTime.Now.ToString();

                MiembroDropDownList.DataSource     = Miembro.Listado(" * ", "1=1", "");
                MiembroDropDownList.DataTextField  = "Nombre";
                MiembroDropDownList.DataValueField = "MiembroId";
                MiembroDropDownList.DataBind();

                CuentaDropDownList.DataSource     = Cuenta.Listado(" * ", "1=1", "");
                CuentaDropDownList.DataTextField  = "Descripcion";
                CuentaDropDownList.DataValueField = "CuentaId";
                CuentaDropDownList.DataBind();

                TipoIngresoDropDownList.DataSource     = TipodeIngreso.Listado(" * ", "1=1", "");
                TipoIngresoDropDownList.DataTextField  = "Descripcion";
                TipoIngresoDropDownList.DataValueField = "TipoIngresoId";
                TipoIngresoDropDownList.DataBind();
            }
        }
Exemple #11
0
        protected void BuscarButton_Click(object sender, EventArgs e)
        {
            Cuentas   c      = new Cuentas();
            DataTable dt     = new DataTable();
            string    filtro = "1=1";

            if (BuscarPorDropdown.SelectedIndex == 0) // CuentaId
            {
                if (FiltroTextBox.Text.Trim().Length == 0)
                {
                    filtro = "1=1";
                }
                else
                {
                    filtro = "CuentaId = " + FiltroTextBox.Text;
                }
            }

            if (BuscarPorDropdown.SelectedIndex == 1) //UsuarioId
            {
                if (FiltroTextBox.Text.Trim().Length == 0)
                {
                    filtro = "1=1";
                }
                else
                {
                    filtro = "UsuarioId = " + FiltroTextBox.Text;
                }
            }

            if (BuscarPorDropdown.SelectedIndex == 2) // Descripcion
            {
                if (FiltroTextBox.Text.Trim().Length == 0)
                {
                    filtro = "1=1";
                }
                else
                {
                    filtro = "Descripcion like '%" + FiltroTextBox.Text + "%'";
                }
            }

            if (BuscarPorDropdown.SelectedIndex == 3) //Balance
            {
                if (FiltroTextBox.Text.Trim().Length == 0)
                {
                    filtro = "1=1";
                }
                else
                {
                    filtro = "Balance = " + FiltroTextBox.Text;
                }
            }

            if (BuscarPorDropdown.SelectedIndex == 4) //Porciento
            {
                if (FiltroTextBox.Text.Trim().Length == 0)
                {
                    filtro = "1=1";
                }
                else
                {
                    filtro = "Porciento = " + FiltroTextBox.Text;
                }
            }

            dt = c.Listado("CuentaId, UsuarioId, Descripcion, Balance, Porciento ", filtro, "");
            CuentasGridView.DataSource = dt;
            CuentasGridView.DataBind();
        }