Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int IdCxC = 0;

            if (!IsPostBack)
            {
                DdIdCuenta.DataSource     = Cuentas.Lista("IdCuenta,Descripcion", "Cuentas");
                DdIdCuenta.DataTextField  = "Descripcion";
                DdIdCuenta.DataValueField = "IdCuenta";
                DdIdCuenta.DataBind();


                int.TryParse(Request.QueryString["IdCxC"], out IdCxC);

                if (cc.Buscar(IdCxC))
                {
                    TbIdCxC.Text             = cc.IdCxC.ToString();
                    DdIdCuenta.SelectedIndex = cc.IdCuenta;
                    TbFecha.Text             = cc.Fecha.ToString("yyyy-MM-dd");
                    TbValor.Text             = cc.Valor.ToString();
                    TbBalance.Text           = cc.Balance.ToString();
                    TbDescripcion.Text       = cc.Descripcion;

                    BtnGuardar.Text = "Actualizar";
                }

                if (DdIdCuenta.SelectedValue != "")
                {
                    if (c.Buscar(DdIdCuenta.SelectedValue) == true)
                    {
                        TbBalance.Text = c.Balance.ToString();
                    }
                }
            }
        }
 private void comboBoxCuentaOrigen_SelectedIndexChanged(object sender, EventArgs e)
 {
     ObtenerOrigen();
     if (cuentas.Buscar(transferencias.OrigenId))
     {
         DevolverOrigen();
     }
     else
     {
         MensajeAdvertencia("Id no encontrado");
         Limpiar();
     }
 }
        protected void Page_Load(object sender, EventArgs e)

        {
            if (!Page.IsPostBack)
            {
                int id = 0;

                LlenarCombos();

                //Leermos el QueryString que llego en la url
                //id = Utilitarios.ToInt(Request.QueryString["Id"].ToString());

                if (id > 0) //si es mayor que cero, buscar el registro
                {
                    Cuentas cuenta = new Cuentas();
                    if (!cuenta.Buscar(id))
                    {
                        Utilitarios.ShowToastr(this.Page, "Registro no encontrado.", "Error", "Error");
                        Limpiar();
                    }
                    else
                    {
                        LlenarCampos(cuenta);
                    }
                }
            }
        }
 private void buttonBuscarId_Click(object sender, EventArgs e)
 {
     ObtenerValores();
     if (textBoxId.Text.Length == 0)
     {
         MessageBox.Show("Debe insertar un Id", "Error al Buscar", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     else
     {
         if (cuentas.Buscar(cuentas.CuentaId))
         {
             DevolverValores();
         }
         else
         {
             MensajeAdvertencia("Id no encontrado");
             Limpiar();
         }
     }
 }
Ejemplo n.º 5
0
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            if (CuentaIdtextBox.TextLength > 0)
            {
                int id;
                int.TryParse(CuentaIdtextBox.Text, out id);
                cuenta.Buscar(id);

                DescripciontextBox.Text = cuenta.Descripcion;
                BalancetextBox.Text     = cuenta.Balance.ToString();
            }
        }
Ejemplo n.º 6
0
        protected void BuscarButton_Click(object sender, EventArgs e)
        {
            Cuentas cuenta = new Cuentas();

            if (cuenta.Buscar(ConvertirId()))
            {
                DescripcionTextBox.Text = cuenta.Descripcion;
                BalanceTextBox.Text     = cuenta.Balance.ToString();
            }
            else
            {
                HttpContext.Current.Response.Write("<SCRIPT>alert('Error al buscar)</SCRIPT>");
            }
        }
Ejemplo n.º 7
0
        protected void BuscarButton_Click(object sender, EventArgs e)
        {
            int Id;

            if (IDCuentaTextBox.Text == "")
            {
                Response.Redirect("~/GUI/cCuentas.aspx");
            }
            else
            {
                Id = int.Parse(IDCuentaTextBox.Text);
                Cuenta.Buscar(Id);
                Cuenta.Descripcion = DescripcionTextBox.Text;
                float flotante = Cuenta.Balance;
                BalanceTextBox.Text = flotante.ToString();
            }
        }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int IdCuenta = 0;

            if (!IsPostBack)
            {
                int.TryParse(Request.QueryString["IdCuenta"], out IdCuenta);

                if (c.Buscar(IdCuenta.ToString()))
                {
                    TbIdCuenta.Text    = c.IdCuenta.ToString();
                    TbDescripcion.Text = c.Descripcion;
                    TbBalence.Text     = c.Balance.ToString();
                    BtnGuardar.Text    = "Actualizar";
                }
            }
        }
        protected void BuscarButton_Click(object sender, EventArgs e)
        {
            if (TbCuentaId.Text == "")
            {
                Utilitarios.ShowToastr(this.Page, "El ID no puede estar en Blanco.", "Advertencia", "Warning");
                return;
            }

            Cuentas cuenta = new Cuentas();

            if (!(cuenta.Buscar(Convert.ToInt16(TbCuentaId.Text))))
            {
                Utilitarios.ShowToastr(this.Page, "Registro no encontrado.", "Error", "Error");
                Limpiar();
                return;
            }

            LlenarCampos(cuenta);
        }
        protected void EliminarButton_Click(object sender, EventArgs e)
        {
            if (TbCuentaId.Text == "")
            {
                Utilitarios.ShowToastr(this.Page, "El ID no puede estar en Blanco.", "Advertencia", "Warning");
                return;
            }
            Cuentas cuenta = new Cuentas();

            if (!(cuenta.Buscar(Convert.ToInt16(TbCuentaId.Text))))
            {
                Utilitarios.ShowToastr(this.Page, "Registro no encontrado.", "Error", "Error");
                Limpiar();
                return;
            }

            if (cuenta.Eliminar())
            {
                Utilitarios.ShowToastr(this.Page, "Transaccion Exitosa.", "Felicidades", "Success");
                Limpiar();
            }
        }