Example #1
0
        private void btnEditar_Click(object sender, EventArgs e)
        {
            //verificamos que todo este lleno.
            if (txtNumero.Text == "" || txtPin.Text == "" || txtSaldo.Text == "")
            {
                MessageBox.Show("Debe llenar los detalles de la cuenta", "Error en ingreso", MessageBoxButtons.OK);
            }
            else
            {
                //instanciamos de la clase cuentaCliente
                CuentaCliente cuenta = new CuentaCliente();
                cuenta.nuevoNumero = txtNumero.Text;
                cuenta.numero      = lstcuentas.SelectedItem.ToString();
                cuenta.pin         = txtPin.Text;
                cuenta.saldo       = Convert.ToDecimal(txtSaldo.Text);

                if (CuentaCliente.ActualizarCuenta(cuenta, lstClientes.SelectedItem.ToString()))
                {
                    MessageBox.Show("Cuenta Actualizada correctamente", "Control de cuentas", MessageBoxButtons.OK);
                    Limpiar();
                }
                else
                {
                    MessageBox.Show("Ocurrió un error duranté la actualización", "Control de Cuentas", MessageBoxButtons.OK);
                }
            }
        }
Example #2
0
 /// <summary>
 /// Metodo de UNITY que se ejecuta al cargar la escena
 /// </summary>
 private void Awake()
 {
     if (clienteDeCuenta == null)
     {
         clienteDeCuenta = this;
         DontDestroyOnLoad(gameObject);
     }
     else if (clienteDeCuenta != this)
     {
         Destroy(gameObject);
     }
 }
Example #3
0
        public DepositoCuentaUsuario(CuentaCliente cuenta) : base(cuenta)
        {
            Add(accbox = new NumberBox
            {
                PlaceholderText = "Numero de cuenta",
                Height          = 30,
                Width           = 250,
                Anchor          = Anchor.Centre,
                Origin          = Anchor.BottomCentre,
                LengthLimit     = 6,
                Y = -30 / 2f * 3 - 10,
            });

            accbox.Current.ValueChanged += _ => CheckButton();
        }
Example #4
0
        public Usuario(CuentaCliente cuenta)
        {
            this.cuenta = cuenta;
            FlujoBotones.AddRange(new BotonOpcion[]
            {
                new BotonOpcion
                {
                    Icono            = FontAwesome.Solid.Search,
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    BackgroundColour = FrameworkColour.Blue,
                    Text             = "Consulta",
                    Action           = () => LoadComponentAsync(new ConsultaUsuario(cuenta), this.Push),
                },
                new BotonOpcion
                {
                    Icono            = FontAwesome.Solid.MoneyBill,
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    BackgroundColour = FrameworkColour.Blue,
                    Text             = "Retiro",
                    Action           = () => LoadComponentAsync(new RetiroUsuario(cuenta), this.Push),
                },
                new BotonOpcion
                {
                    Icono            = FontAwesome.Solid.Save,
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    BackgroundColour = FrameworkColour.Blue,
                    Text             = "Deposito",
                    Action           = () => LoadComponentAsync(new DepositoUsuario(cuenta), this.Push),
                },
                new BotonOpcion
                {
                    Anchor           = Anchor.Centre,
                    Origin           = Anchor.Centre,
                    BackgroundColour = Color4.OrangeRed,
                    Icono            = FontAwesome.Solid.SignOutAlt,
                    Text             = "Salir",
                    Action           = Salir,
                }
            });

            Titulo           = $"Nos alegra tenerte aquí, {cuenta.Nombre.PrimerNombre}";
            ColorFondoTitulo = Color4.MediumSlateBlue;
        }
Example #5
0
        private void lstClientes_Click(object sender, EventArgs e)
        {
            // obtenemos la lista de todos los clientes de la tabla
            List <CuentaCliente> listaCuenta = CuentaCliente.LeerTodasCuentas(lstClientes.SelectedItem.ToString());

            // Limpiar el listView
            lstcuentas.Items.Clear();

            // Verificar si existen departamentos
            if (listaCuenta.Any())
            {
                listaCuenta.ForEach(Cliente => lstcuentas.Items.Add(Cliente.numero));
            }
            else
            {
                lstcuentas.Items.Add("¡No hay cuentas!");
            }
        }
Example #6
0
        private void lstcuentas_Click(object sender, EventArgs e)
        {
            //cargamos el dato de saldo para ser actualizado.
            CuentaCliente existe = CuentaCliente.ObtenerCliente(lstcuentas.SelectedItem.ToString());

            //verificamos si el cliente esta registrado e inhabilitamos el boton guardar
            if (existe.numero != "")
            {
                // deshabilitamos el boton de guardar, dado que ya existe el cliente
                btnAgregar.Enabled  = false;
                btnEditar.Enabled   = true;
                btnEliminar.Enabled = true;
                txtNumero.Text      = existe.numero;
                txtPin.Text         = existe.pin;
                txtSaldo.Text       = Convert.ToString(existe.saldo);
            }
            else
            {
                MessageBox.Show("Error en cargar datos");
            }
        }
Example #7
0
        public DepositoPropioUsuario(CuentaCliente cuenta)
        {
            ColorFondoTitulo = Color4.MediumSlateBlue;
            Titulo           = "Configure su deposito";
            OnAlertHide      = guardarRetiro;
            this.cuenta      = cuenta;
            Add(textbox      = new DecimalBox
            {
                PlaceholderText = "Cantidad",
                Height          = 30,
                Width           = 250,
                Anchor          = Anchor.Centre,
                Origin          = Anchor.BottomCentre,
                Y = -30 / 2f - 10,
            });
            Add(submit = new BotonHover
            {
                Size             = new Vector2(250, 30),
                BackgroundColour = disabledColor,
                Text             = "Entrar",
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
            });
            Add(new BotonOpcion
            {
                Anchor           = Anchor.BottomLeft,
                Origin           = Anchor.BottomLeft,
                BackgroundColour = Color4.OrangeRed,
                Icono            = FontAwesome.Solid.ArrowCircleLeft,
                Text             = "Regresar",
                Margin           = new MarginPadding(20),
                Action           = this.Exit,
            });

            submit.Action       += revisarRetiro;
            submit.Enabled.Value = false;

            textbox.Current.ValueChanged += _ => CheckButton();
        }
Example #8
0
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            if (lstClientes.SelectedIndex == -1 || txtPin.Text == "" || txtSaldo.Text == "")
            {
                MessageBox.Show("Debe de seleccionar un cliente y llenar todos los datos", "Error en ingreso", MessageBoxButtons.OK);
            }
            else
            {
                // Instanciamos de la clase cuentaCliente y gurdamos los datos.
                CuentaCliente nuevo = new CuentaCliente();
                nuevo.numero = txtNumero.Text;
                nuevo.pin    = txtPin.Text;
                nuevo.saldo  = Convert.ToDecimal(txtSaldo.Text);

                if (CuentaCliente.InsertarCuenta(nuevo, lstClientes.SelectedItem.ToString()))
                {
                    MessageBox.Show("La cuenta se Guardó correctamente", "Control de cuentas", MessageBoxButtons.OK);
                }
                else
                {
                    MessageBox.Show("Ocurrió un error durante la inserción", "Control de cuentas", MessageBoxButtons.OK);
                }
            }
        }
Example #9
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            //verificamos que hayan seleccionado una cuenta
            if (lstcuentas.SelectedIndex == -1)
            {
                MessageBox.Show("Debe seleccionar una cuenta", "Error en ingreso", MessageBoxButtons.OK);
            }
            else
            {
                //Instanciamos de la claseCuentaCliete
                CuentaCliente cuenta = new CuentaCliente();
                cuenta.numero = lstcuentas.SelectedItem.ToString();

                if (CuentaCliente.EliminarCuenta(cuenta))
                {
                    MessageBox.Show("La cuenta se eliminó correctamente", "Control de cuentas", MessageBoxButtons.OK);
                    Limpiar();
                }
                else
                {
                    MessageBox.Show("Ocurrió un error durante la eliminación");
                }
            }
        }
Example #10
0
 public DepositoUsuario(CuentaCliente cuenta)
 {
     Titulo           = "Realiza un deposito";
     ColorFondoTitulo = Color4.MediumSlateBlue;
     this.cuenta      = cuenta;
     FlujoBotones.AddRange(new BotonOpcion[]
     {
         new BotonOpcion
         {
             Icono            = FontAwesome.Solid.User,
             Anchor           = Anchor.Centre,
             Origin           = Anchor.Centre,
             BackgroundColour = FrameworkColour.Blue,
             Text             = "Propia cuenta",
             Action           = () => LoadComponentAsync(new DepositoPropioUsuario(cuenta), this.Push),
         },
         new BotonOpcion
         {
             Icono            = FontAwesome.Solid.Users,
             Anchor           = Anchor.Centre,
             Origin           = Anchor.Centre,
             BackgroundColour = FrameworkColour.Blue,
             Text             = "Otra cuenta",
             Action           = () => LoadComponentAsync(new DepositoCuentaUsuario(cuenta), this.Push),
         },
         new BotonOpcion
         {
             Anchor           = Anchor.Centre,
             Origin           = Anchor.Centre,
             BackgroundColour = Color4.OrangeRed,
             Icono            = FontAwesome.Solid.ArrowCircleLeft,
             Text             = "Regresar",
             Action           = this.Exit,
         }
     });
 }
Example #11
0
        public ConsultaUsuario(CuentaCliente cuenta)
        {
            this.cuenta = cuenta;

            Add(new BasicScrollContainer <Drawable>
            {
                Padding = new MarginPadding()
                {
                    Top = 110
                },
                RelativeSizeAxes = Axes.Both,
                Width            = 0.5f,
                Anchor           = Anchor.BottomRight,
                Origin           = Anchor.BottomRight,
                Child            = flujoHistorial = new FillFlowContainer <HistorialVisual>
                {
                    Spacing          = new Vector2(0, 10),
                    Anchor           = Anchor.TopRight,
                    Origin           = Anchor.TopRight,
                    AutoSizeAxes     = Axes.Y,
                    RelativeSizeAxes = Axes.X,
                    Direction        = FillDirection.Vertical,
                }
            });
            Add(new Box
            {
                Colour           = Color4.Black,
                RelativeSizeAxes = Axes.X,
                Height           = 110
            });
            Add(new BotonOpcion
            {
                Anchor           = Anchor.BottomLeft,
                Origin           = Anchor.BottomLeft,
                BackgroundColour = Color4.OrangeRed,
                Icono            = FontAwesome.Solid.ArrowCircleLeft,
                Text             = "Regresar",
                Margin           = new MarginPadding(20),
                Action           = this.Exit,
            });
            Add(new SpriteText
            {
                Text     = "Tu saldo:",
                Font     = new FontUsage(size: 60),
                Position = new Vector2(20, 50),
            });
            Add(new SpriteText
            {
                Text     = $"${cuenta.Saldo:0.##}",
                Font     = new FontUsage(size: 100),
                Position = new Vector2(20, 120),
            });
            Add(new SpriteText
            {
                Text = "Tus movimientos:",
                Font = new FontUsage(size: 60),
                RelativePositionAxes = Axes.X,
                Position             = new Vector2(0.5f, 50),
            });
            Add(new SpriteText
            {
                Anchor   = Anchor.TopRight,
                Origin   = Anchor.BottomRight,
                Position = new Vector2(-300, 110),
                Font     = new FontUsage(size: 30),
                Text     = "Mes:",
            });
            Add(seleccionMes = new BasicDropdown <YearMonthTuple>
            {
                Anchor = Anchor.TopRight,
                Origin = Anchor.TopLeft,
                Width  = 200,
            });

            seleccionMes.Current.ValueChanged += RecargarElementos;

            ColorFondoTitulo = Color4.MediumSlateBlue;
            Titulo           = "Tu cuenta";
        }
Example #12
0
        public RetiroUsuario(CuentaCliente cuenta)
        {
            this.cuenta = cuenta;

            Add(submit20 = new BotonHover
            {
                Size             = new Vector2(250, 30),
                BackgroundColour = new Color4(90, 120, 198, 255),
                Text             = "$20",
                Anchor           = Anchor.Centre,
                Origin           = Anchor.CentreRight,
                Position         = new Vector2(-5, -35),
                Action           = () => retirar(20)
            });
            Add(submit40 = new BotonHover
            {
                Size             = new Vector2(250, 30),
                BackgroundColour = new Color4(90, 120, 198, 255),
                Text             = "$40",
                Anchor           = Anchor.Centre,
                Origin           = Anchor.CentreLeft,
                Position         = new Vector2(5, -35),
                Action           = () => retirar(40)
            });
            Add(submit60 = new BotonHover
            {
                Size             = new Vector2(250, 30),
                BackgroundColour = new Color4(90, 120, 198, 255),
                Text             = "$60",
                Anchor           = Anchor.Centre,
                Origin           = Anchor.CentreRight,
                Action           = () => retirar(60),
                X = -5
            });
            Add(submit100 = new BotonHover
            {
                Size             = new Vector2(250, 30),
                BackgroundColour = new Color4(90, 120, 198, 255),
                Text             = "$100",
                Anchor           = Anchor.Centre,
                Origin           = Anchor.CentreLeft,
                Action           = () => retirar(100),
                X = 5
            });
            Add(submit200 = new BotonHover
            {
                Size             = new Vector2(250, 30),
                BackgroundColour = new Color4(90, 120, 198, 255),
                Text             = "$200",
                Anchor           = Anchor.Centre,
                Origin           = Anchor.Centre,
                Action           = () => retirar(200),
                Y = 35
            });
            Add(new BotonOpcion
            {
                Anchor           = Anchor.BottomLeft,
                Origin           = Anchor.BottomLeft,
                BackgroundColour = Color4.OrangeRed,
                Icono            = FontAwesome.Solid.ArrowCircleLeft,
                Text             = "Regresar",
                Margin           = new MarginPadding(20),
                Action           = this.Exit,
            });
            ColorFondoTitulo = Color4.MediumSlateBlue;
            Titulo           = "Realiza un retiro";
        }