Esempio n. 1
0
        // GET: Expense
        public ActionResult Index()
        {
            ClaimsPrincipal currentUser = User;

            var              userId   = currentUser.FindFirst(ClaimTypes.NameIdentifier).Value;
            ExpenseClient    client   = new ExpenseClient();
            ExpenseViewModel md       = new ExpenseViewModel();
            List <Account>   aclist   = md.GetAccountIdList(userId);
            List <int>       accounts = new List <int>();

            foreach (var el in aclist)
            {
                accounts.Add(el.Id);
            }
            ViewBag.expenselist = client.FindAll(accounts).OrderByDescending(x => x.Time);

            ViewBag.expenseviewmodel = md;
            return(View(md));
        }