Exemplo n.º 1
0
        public PartialViewResult Index(WebUser user)
        {
            DebtsSumModel model;

            try
            {
                var items = _debtService.GetOpenUserDebts(user.Id).ToList();
                model = new DebtsSumModel()
                {
                    MyDebtsSumm   = items.Where(x => x.TypeOfFlowId == 1).Sum(x => x.Summ),
                    DebtsToMeSumm = items.Where(x => x.TypeOfFlowId == 2).Sum(x => x.Summ)
                };
            }
            catch (Exception e)
            {
                throw new WebUiException($"Ошибка {e.GetType()} в контроллере {nameof(DebtController)} в методе {nameof(Index)}", e);
            }

            return(PartialView("_Index", model));
        }