Exemplo n.º 1
0
        public IActionResult NewExpenseList()
        {
            //int userId = 1;
            //var teamId = _repository.Users.GetUserTeamId(userId);
            //var team = _repository.Teams.GetTeamWithMembersById(teamId);
            //var flatmates = team.UsersCollection.Where(el => el.UserId != userId).ToList();
            var viewModel = new NewExpenseListViewModel();

            return(View(viewModel));
        }
Exemplo n.º 2
0
 public IActionResult NewExpenseList([Bind("ExtExpenseItems")] NewExpenseListViewModel expenseViewModel)
 {
     //int userId = 1;
     //if (ModelState.IsValid)
     //{
     //    var expenses = expenseViewModel.ExtExpenseItems.Select(el => _mapper.Map<Expense>(el)).ToList();
     //    foreach (var exp in expenses)
     //    {
     //        exp.InitiatorId = userId;
     //    }
     //    _repository.Expenses.AddRange(expenses);
     //    await _repository.CompleteAsync();
     //    return RedirectToAction(nameof(Index));
     //}
     return(View());
 }