public async Task <IActionResult> Create(TransactionActionViewModel model)
        {
            if (ModelState.IsValid)
            {
                var username = User.Identity.Name;
                var user     = await _userManager.FindByNameAsync(username);

                var profile = await _profileService.GetProfileByUserId(user.Id);

                var transactionDto = new TransactionsDto
                {
                    Description = model.Description,
                    Comment     = model.Comment,
                    Amount      = model.Amount,
                    //Currency
                    CurrencyType = 933,
                    CreationTime = DateTime.Now,
                    ProfileId    = profile.Id,
                    GroupId      = model.GroupId,
                };

                await _transactionsService.AddAsync(transactionDto);

                return(RedirectToAction("Detail", "Group", new { id = model.GroupId }));
            }

            return(View(model));
        }
        public IActionResult Create(int id)
        {
            var transactionActionViewModel = new TransactionActionViewModel
            {
                GroupId = id
            };

            return(View(transactionActionViewModel));
        }
        public async Task <IActionResult> Edit(int id)
        {
            var tarnsactionDto = await _transactionsService.GetTransactionAsync(id);

            var transactionActionViewModel = new TransactionActionViewModel
            {
                Id          = tarnsactionDto.Id,
                Description = tarnsactionDto.Description,
                Comment     = tarnsactionDto.Comment,
                Amount      = tarnsactionDto.Amount
            };

            return(View(transactionActionViewModel));
        }
        public async Task <IActionResult> Edit(TransactionActionViewModel model)
        {
            if (ModelState.IsValid)
            {
                var transactionDto = new TransactionsDto
                {
                    Id          = model.Id,
                    Description = model.Description,
                    Comment     = model.Comment,
                    Amount      = model.Amount
                };

                await _transactionsService.EditAsync(transactionDto);

                return(RedirectToAction("Index", "Transaction", new { id = transactionDto.Id }));
            }
            return(View(model));
        }