public ActionResult Index()
        {
            var _userHelper = new UserHelper();
            var isAdmin = _userHelper.IsUserInRole("admin");
            ViewData["IsAdmin"] = isAdmin;

            var list = isAdmin  ? _service.ListTransactions()
                                : _service.ListTransactions(_userHelper.CurrentUserId);

            Mapper.CreateMap<Transaction, Transactions>();
            var viewModelList = new TransactionViewModel();

            viewModelList.Transactions = Mapper.Map<IList<Transaction>, IList<Transactions>>(list);
            viewModelList.Filter = _service.GetFilter();
            viewModelList.Filter.PaymentMethodsList.SetAllSelected();
            viewModelList.TotalSum = viewModelList.Transactions.Sum(t => t.Sum);

            return View(viewModelList);
        }
        public ActionResult FiltredList(FormCollection formCollection)
        {
            var filter = new TransactionsFilter(formCollection);

            var _userHelper = new UserHelper();
            var isAdmin = _userHelper.IsUserInRole(ROLES.admin.ToString());
            ViewData["IsAdmin"] = isAdmin;

            //------------------
            //var list = isAdmin  ? _service.ListTransactions(filter)
                                //: _service.ListTransactions(_userHelper.CurrentUserId);

            //Mapper.CreateMap<Transaction, Transactions>();
            var viewModelList = new TransactionViewModel();
            //viewModelList.Transactions = Mapper.Map<IList<Transaction>, IList<Transactions>>(list);
            viewModelList.Transactions = _service.ListTransactions(filter);
            viewModelList.Filter = _service.GetFilter();

            return View("Index", viewModelList);
        }