示例#1
0
        public ActionResult RecordList(int?page, bool editMode = false)
        {
            ViewBag.EditMode = editMode;

            var records = _contentSvc.GetRecords();
            int pageIdx = page ?? 1;

            ViewBag.OnePageOfRecords = records.ToPagedList(pageIdx, _itemsPerPage);
            return(View());
        }
示例#2
0
        private SyndicationFeed GetFeedData()
        {
            var feed = new SyndicationFeed(
                "我的帳本資料",
                "訂單RSS!",
                new Uri(Url.Action("Rss", "Feed", null, "http")));

            var items = new List <SyndicationItem>();

            var records = _contentSvc.GetRecords();

            foreach (var record in records)
            {
                var item = new SyndicationItem(
                    string.Format("{0} {1}", record.Type, record.Amount),
                    record.Message.ToString(),
                    new Uri(Url.Action("Detail", "Home", new { id = record.Id }, "http")),
                    "ID",
                    record.Date);

                items.Add(item);
            }

            feed.Items = items;
            return(feed);
        }