public static List <Compra> GetComprasByUserID(int UserId)
    {
        if (UserId <= 0)
        {
            throw new ArgumentException("El UserId no debe ser menor igual a 0");
        }

        CompraTableAdapter adapter = new CompraTableAdapter();

        Compra_DS.CompraDataTable table  = adapter.GetComprasByUserID(UserId);
        List <Compra>             result = new List <Compra>();
        Compra temp;

        foreach (var row in table)
        {
            temp                = new Compra();
            temp.CompraId       = row.CompraId;
            temp.Fecha          = row.fecha;
            temp.TotalPago      = row.totalPago;
            temp.TarjetaCredito = row.tarjetaCredito;
            temp.CodigoTarjeta  = row.codigoTarjeta;
            temp.Estado         = row.estado;
            temp.UserId         = row.UserId;
            UserCLI userTemp = UserCLI_BRL.getUserById(row.UserId);
            temp.Email      = userTemp.Email;
            temp.PeliculaId = row.peliculaId;
            Pelicula moviesTemp = Pelicula_BRL.GetPeliculaByID(row.peliculaId);
            temp.NombrePelicula = moviesTemp.Nombre;

            result.Add(temp);
        }

        return(result);
    }
    public static List <Transaction> GetAllTransactionByUserId(int UserId)
    {
        if (UserId <= 0)
        {
            throw new ArgumentException("El UserId debe ser mayor a 1");
        }
        List <Transaction> listTransaction = new List <Transaction>();
        //Obtieniendo Compras por UserID
        CompraTableAdapter adapterCompra = new CompraTableAdapter();

        Compra_DS.CompraDataTable tableCompra = adapterCompra.GetComprasByUserID(UserId);
        Transaction tempTransaction;
        UserCLI     tempUser;
        Pelicula    tempMovie;

        foreach (var row in tableCompra)
        {
            if (row.estado)
            {
                tempTransaction                  = new Transaction();
                tempTransaction.TotalPago        = row.totalPago;
                tempTransaction.FechaTransaction = row.fecha;
                tempTransaction.UserId           = row.UserId;
                tempUser = UserCLI_BRL.getUserById(row.UserId);
                tempTransaction.UserName       = tempUser.Nombre;
                tempTransaction.EmailUser      = tempUser.Email;
                tempTransaction.TarjetaCredito = row.tarjetaCredito;
                tempTransaction.CodigoTarjeta  = row.codigoTarjeta;
                tempTransaction.PeliculaId     = row.peliculaId;
                tempMovie = Pelicula_BRL.GetPeliculaByID(row.peliculaId);
                tempTransaction.NombrePelicula = tempMovie.Nombre;
                tempTransaction.Foto           = tempMovie.Foto;
                tempTransaction.Description    = tempMovie.Descripcion;
                tempTransaction.Director       = tempMovie.Director;
                tempTransaction.Elenco         = tempMovie.Elenco;
                tempTransaction.Label          = "<span class='label label-default pull-right'" +
                                                 "style='border-radius:3px; background-color:#5cb85c; color:#fff; padding: 6px 3px'" +
                                                 ">Venta</span>";


                listTransaction.Add(tempTransaction);
            }
        }

        AlquilerTableAdapter adapterAlquiler = new AlquilerTableAdapter();

        Alquiler_DS.AlquilerDataTable tableAlquiler = adapterAlquiler.GetAlquileresByUserID(UserId);

        foreach (var row in tableAlquiler)
        {
            if (row.estado)
            {
                TimeSpan ts        = DateTime.Now - row.fechaDevol;
                int      diference = ts.Days;
                if (diference > 0)
                {
                    Alquiler_BRL.DeleteAlquiler(row.AlquilerId);
                }
                else
                {
                    tempTransaction                  = new Transaction();
                    tempTransaction.TotalPago        = row.totalPago;
                    tempTransaction.FechaTransaction = row.fechaAlqui;
                    tempTransaction.UserId           = row.UserId;
                    tempUser = UserCLI_BRL.getUserById(row.UserId);
                    tempTransaction.UserName       = tempUser.Nombre;
                    tempTransaction.EmailUser      = tempUser.Email;
                    tempTransaction.TarjetaCredito = row.tarjetaCredito;
                    tempTransaction.CodigoTarjeta  = row.codigoTarjeta;
                    tempTransaction.PeliculaId     = row.peliculaId;
                    tempMovie = Pelicula_BRL.GetPeliculaByID(row.peliculaId);
                    tempTransaction.NombrePelicula = tempMovie.Nombre;
                    tempTransaction.Foto           = tempMovie.Foto;
                    tempTransaction.Description    = tempMovie.Descripcion;
                    tempTransaction.Director       = tempMovie.Director;
                    tempTransaction.Elenco         = tempMovie.Elenco;
                    tempTransaction.Label          = "<span class='label label-default pull-right'" +
                                                     "style='border-radius:3px; background-color:#777; color:#fff; padding: 6px 3px'" +
                                                     ">Alquiler</span>";


                    listTransaction.Add(tempTransaction);
                }
            }
        }

        return(listTransaction);
    }