Ejemplo n.º 1
0
 //
 // GET: /Stats/
 public ActionResult Index()
 {
     StatsViewModel model = new StatsViewModel(User.Identity.GetUserId());
     if (model.entries.Count > 0)
         return View(model);
     else
         return View("NoEntries");
 }
Ejemplo n.º 2
0
 public object GetMostExpensivePurchase()
 {
     StatsViewModel model = new StatsViewModel(User.Identity.GetUserId());
     return (from entry in model.MostExpensivePurchases
                 select new {
                     Name = entry.EntryName,
                     Sum = entry.EntrySum,
                     Date = entry.EntryDate,
                     Description = entry.EntryDescription
                 }).First();
 }