File size: 1,419 Bytes
e26fba6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Script.Serialization;
using MovieTube.Web.Models;
using MovieTube.Web.Attributes;
namespace MovieTube.Web.Controllers
{
public class HomeController : BaseMvcController
{
//
// GET: /Home/
// [OutputCache(Duration=3600)]
public ActionResult Index(int? year, int? page, string term = "", string language = "")
{
var tn = repository.List(term,language,year, page);
var d = new JavaScriptSerializer().Serialize(new
{
showWatchView = false,
activeView = language,
thumbInfo = tn
});
return View("Index",(object)d);
}
public ActionResult Watch(string language, int year, string id, string title)
{
var movie = repository.QueryMovie(id, true);
var d = new JavaScriptSerializer().Serialize(new
{
showWatchView = true,
activeView = "watch",
movie = movie,
thumbInfo = new ThumbNailVm()
});
return View("Index", (object)d);
}
public ActionResult Player()
{
return View("_Player");
}
}
}
|