Пример #1
0
        public List <String> estadoCuentaFINT(int idcuenta, String fecha)
        {
            List <String> retorno  = new List <string>();
            DataSet       dsGastos = new DataSet();

            Gasto gast = new Gasto();

            dsGastos = gast.obtenerGastoXcuenta(idcuenta);
            dsGastos.Tables[0].Columns.Add("Display", typeof(string), "Concepto + ':  Total: ' + Monto");
            Cuenta cuen = new Cuenta();

            cuen = cuen.obtenerObjCuenta(idcuenta);
            Decimal  tmpMonto = cuen.Saldo;
            DateTime tmpFecha = DateTime.Parse(fecha);
            DateTime fechaaux;

            for (int i = 0; i < dsGastos.Tables[0].Rows.Count; i++)
            {
                fechaaux = DateTime.Parse(dsGastos.Tables[0].Rows[i]["Vencimiento"].ToString());
                if (fechaaux.CompareTo(tmpFecha) <= 0)
                {
                    tmpMonto -= Decimal.Parse(dsGastos.Tables[0].Rows[i]["Monto"].ToString());
                    retorno.Add(dsGastos.Tables[0].Rows[i]["Display"].ToString());
                }
            }
            retorno.Add("#### Saldo final: " + tmpMonto + " ####");

            return(retorno);
        }
Пример #2
0
        public Boolean realizarPago(int idGasto, int idCuenta)
        {
            Gasto  tmpGasto  = new Gasto();
            Cuenta tmpCuenta = new Cuenta();

            try
            {
                //Armo los objetos de cuenta y gasto
                tmpGasto  = tmpGasto.obtenerObjGasto(idGasto);
                tmpCuenta = tmpCuenta.obtenerObjCuenta(idCuenta);

                //Creo la transaccion
                Transaccion transac = new Transaccion("Pago cuenta", tmpGasto.Monto, DateTime.Today.ToString("dd/MM/yyyy"), tipoTransaccion.Extraccion, estado.Realizada, tmpGasto.Id, tmpCuenta.Id, 0, "");
                //Descuento los montos de la cuenta y cambio de estado al gasto
                tmpCuenta.realizarMovimiento(transac);
                tmpGasto.Estado = estado.Realizada;

                //guardo la cuenta y el gasto
                tmpCuenta.modificarCuenta(tmpCuenta);
                tmpGasto.modificarEstadoGasto(tmpGasto.Id, (int)tmpGasto.Estado);
                transac.ingresarTransaccion(transac);
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Пример #3
0
        public List <String> estadoCuentaServicio(int idcuenta)
        {
            Cuenta cue = new Cuenta();

            cue.obtenerObjCuenta(idcuenta);
            String numc = cue.NumeroCuenta;

            appProveedorFachadaProxy.appProveedorFachada serviceProveedor = new appProveedorFachadaProxy.appProveedorFachada();
            return(new List <String>(serviceProveedor.obtenerEstadoCuenta(numc)));
        }
Пример #4
0
        public Boolean realizarExtraccion(int idCuenta, Decimal monto, String concepto)
        {
            Cuenta cuenta = new Cuenta();

            cuenta.obtenerObjCuenta(idCuenta);
            Transaccion transacExt = new Transaccion(concepto, monto, idCuenta, tipoTransaccion.Extraccion, estado.Realizada);

            if (cuenta.realizarMovimiento(transacExt))
            {
                transacExt.ingresarTransaccion(transacExt);
                return(true);
            }
            return(false);
        }
Пример #5
0
        public Boolean realizarTransferencia(int pCuentaOrig, int pCuentaDestino, Decimal monto, String concepto)
        {
            Cuenta orig = new Cuenta();
            Cuenta dest = new Cuenta();

            orig = orig.obtenerObjCuenta(pCuentaOrig);
            dest = dest.obtenerObjCuenta(pCuentaDestino);
            Transaccion transac = new Transaccion(concepto, monto, pCuentaOrig, pCuentaDestino, tipoTransaccion.Transferencia, estado.Realizada);

            if (orig.realizarMovimiento(transac) && dest.realizarMovimiento(transac))
            {
                transac.ingresarTransaccion(transac);
                return(true);
            }
            return(false);
        }
Пример #6
0
        public Boolean confirmarPagoCliente(int idtransac)
        {
            Transaccion tmptransac = new Transaccion();

            try
            {
                tmptransac.obtenerObjTransac(idtransac);
                tmptransac.EstadoTransaccion = estado.Realizada;
                Cuenta cuen = new Cuenta();
                cuen = cuen.obtenerObjCuenta(tmptransac.IdCuentainicial);
                cuen.realizarMovimiento(tmptransac);
                tmptransac.modificarTransaccion(tmptransac);
                return(true);
            }
            catch (Exception e)
            {
                return(false);
            }
        }