Exemplo n.º 1
0
        public List <Tarjetas> getTodasTarjetas(String cedula)
        {
            EnviarCorreo  e   = new EnviarCorreo();
            Conexion      c   = new Conexion();
            SqlConnection con = new SqlConnection();

            con = c.ObtenerConexion();


            try
            {
                using (con)
                {
                    SqlCommand cmd = new SqlCommand("targetasCliente", con);

                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.AddWithValue("@cedula", cedula);


                    SqlDataReader reader = cmd.ExecuteReader();

                    List <Tarjetas> tar = new List <Tarjetas>();



                    String num;

                    while (reader.Read())
                    {
                        Tarjetas pr = new Tarjetas();


                        pr.setNumtargeta(reader["NumTarjeta"].ToString());



                        tar.Add(pr);

                        num = pr.getNumtargeta();
                    }
                    con.Close();

                    return(tar);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        public List <Movimientos> getDatosMovimientos(String cuenta)
        {
            EnviarCorreo  e   = new EnviarCorreo();
            Conexion      c   = new Conexion();
            SqlConnection con = new SqlConnection();

            con = c.ObtenerConexion();


            try
            {
                using (con)
                {
                    SqlCommand cmd = new SqlCommand("MovimientosCuenta", con);

                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.AddWithValue("@numcuenta", cuenta);


                    SqlDataReader reader = cmd.ExecuteReader();

                    List <Movimientos> tar = new List <Movimientos>();



                    while (reader.Read())
                    {
                        Movimientos pr = new Movimientos();

                        pr.setNumtarjeta(reader["NumTarjeta"].ToString());
                        pr.setSaldo(reader["Saldo"].ToString());
                        pr.setMonto(reader["Monto"].ToString());
                        pr.setDescripcion(reader["Descripcion"].ToString());
                        pr.setFechamovimiento(reader["FechaMovimiento"].ToString());



                        tar.Add(pr);
                    }
                    con.Close();

                    return(tar);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 3
0
        public Cuentas getDatosEstados(String cuenta)
        {
            EnviarCorreo  e   = new EnviarCorreo();
            Conexion      c   = new Conexion();
            SqlConnection con = new SqlConnection();

            con = c.ObtenerConexion();


            try
            {
                using (con)
                {
                    SqlCommand cmd = new SqlCommand("SaldoCuenta1", con);

                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.AddWithValue("@numcuenta", cuenta);


                    SqlDataReader reader = cmd.ExecuteReader();

                    List <Cuentas> tar = new List <Cuentas>();

                    Cuentas pr = new Cuentas();

                    while (reader.Read())
                    {
                        pr.setSaldo(reader["Saldo"].ToString());
                        pr.setSaldobloqueado(reader["SaldoBloqueado"].ToString());
                        pr.setSaldocongelado(reader["SaldoCongelado"].ToString());
                        pr.setTitular(reader["NombreCompleto"].ToString());



                        tar.Add(pr);
                    }
                    con.Close();

                    return(pr);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 4
0
        public Prestamos getPrestamos(String targeta)
        {
            EnviarCorreo  e   = new EnviarCorreo();
            Conexion      c   = new Conexion();
            SqlConnection con = new SqlConnection();

            con = c.ObtenerConexion();


            try
            {
                using (con)
                {
                    SqlCommand cmd = new SqlCommand("PrestamosEnla", con);

                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.AddWithValue("@numprestamo", targeta);


                    SqlDataReader reader = cmd.ExecuteReader();

                    List <Prestamos> tar = new List <Prestamos>();

                    Prestamos pr = new Prestamos();
                    while (reader.Read())
                    {
                        pr.setNumcuenta(reader["NumCuenta"].ToString());
                        pr.setSaldo(reader["Saldo"].ToString());
                        pr.setInformacion(reader["informacion"].ToString());
                        pr.setCuota(reader["Cuota"].ToString());
                        pr.setFechapago(reader["FechaPago"].ToString());
                        pr.setOpcionpago(reader["OpcionPago"].ToString());

                        tar.Add(pr);
                    }
                    con.Close();

                    return(pr);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 5
0
        public Tarjetas getDatosTarjetas(String targeta)
        {
            EnviarCorreo  e   = new EnviarCorreo();
            Conexion      c   = new Conexion();
            SqlConnection con = new SqlConnection();

            con = c.ObtenerConexion();


            try
            {
                using (con)
                {
                    SqlCommand cmd = new SqlCommand("OpcionesTar", con);

                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.AddWithValue("@NumTar", targeta);


                    SqlDataReader reader = cmd.ExecuteReader();

                    List <Tarjetas> tar = new List <Tarjetas>();

                    Tarjetas pr = new Tarjetas();
                    while (reader.Read())
                    {
                        pr.setDeuda(reader["Deuda"].ToString());
                        pr.setFechapago(reader["FechaPago"].ToString());
                        pr.setOpcionpago(reader["OpcionPago"].ToString());


                        tar.Add(pr);
                    }
                    con.Close();

                    return(pr);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 6
0
        public List <Cuentas> getCuentas(String Cedula)
        {
            EnviarCorreo  e   = new EnviarCorreo();
            Conexion      c   = new Conexion();
            SqlConnection con = new SqlConnection();

            con = c.ObtenerConexion();


            try
            {
                using (con)
                {
                    SqlCommand cmd = new SqlCommand("CuentasAsociadas", con);

                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.AddWithValue("@cedula", Cedula);


                    SqlDataReader reader = cmd.ExecuteReader();

                    List <Cuentas> cuen = new List <Cuentas>();


                    while (reader.Read())
                    {
                        Cuentas ce = new Cuentas();

                        ce.setNumcuenta(reader["NumCuenta"].ToString());
                        cuen.Add(ce);
                    }
                    con.Close();

                    return(cuen);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 7
0
        public void GenerarToken(String correo)
        {
            Conexion      c   = new Conexion();
            SqlConnection con = new SqlConnection();

            con = c.ObtenerConexion();

            Random r   = new Random();
            int    num = r.Next(0, 9999);



            EnviarCorreo ev = new EnviarCorreo();

            ev.EnviarToken(correo, num);


            try
            {
                using (con)
                {
                    SqlCommand cmd = new SqlCommand("ActualizarToken", con);

                    cmd.CommandType = CommandType.StoredProcedure;

                    cmd.Parameters.AddWithValue("@correo", correo);
                    cmd.Parameters.AddWithValue("@token", num);

                    cmd.ExecuteScalar();

                    con.Close();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }