예제 #1
0
        //public class AlbumWithCount
        //{
        //    public Models.Album Data { get; set; }
        //    public int ReadCount { get; set; }
        //}


        // GET: Home
        public ActionResult Index()
        {
            //ViewBag.ID = id;
            Service.DataService data = new Service.DataService();
            var list = data.LoadAllAlbum();

            return(View(list));
        }
예제 #2
0
        public ActionResult timetable(string id)
        {
            Models.Album        item = null;
            Service.DataService data = new Service.DataService();
            var list = data.LoadAllAlbum();

            item = list.SingleOrDefault(x => x.ID == id);
            return(View(item));
        }
예제 #3
0
        // GET: Home
        public ActionResult Index(string id, string name, string title)
        {
            ViewBag.ID = id;
            Service.DataService data = new Service.DataService();
            var list   = data.LoadAllAlbum();
            var result = list.ToList().Select(x =>
            {
                var item       = new AlbumWithCount();
                item.Data      = x;
                item.ReadCount = 100;
                return(item);
            }).ToList();

            //ViewBag.ReadCount = 0;

            return(View(result));
            //return Content("<h1>hello world</h1>" + id);
        }