Example #1
0
        public IActionResult RequestHistory()
        {
            var user     = _userManager.GetUserId(HttpContext.User);
            var customer = _cusService.GetByUser(user);
            var Mod      = _modservice.GetByCustomer(customer.Id).
                           Select(m => new ModDetailModel
            {
                Movie     = m.Movie,
                MovieTime = m.MovieTime,
                Status    = m.Status.Name
            });

            var model = new ModIndexModel
            {
                ModList = Mod
            };

            return(View(model));
        }
Example #2
0
        // GET: Admin/MOD
        public async Task <IActionResult> Index()
        {
            var movies = await _context.MoviesOnDemand.
                         Include(m => m.Status).
                         Include(m => m.Customer).
                         OrderByDescending(m => m.Id).
                         Select(m => new ModDetailModel()
            {
                Id        = m.Id,
                Movie     = m.Movie,
                MovieTime = m.MovieTime,
                Status    = m.Status,
                Card      = m.Customer.CustomerCard
            }).ToListAsync();

            var model = new ModIndexModel()
            {
                Mod = movies
            };

            return(View(model));
        }