Пример #1
0
        public IActionResult CreateTransaction(Guid accountGuid, float itemCost, string itemName, DateTime dateTime)
        {
            // what to do if read fails
            Guid userGuid = Guid.Parse(Read("userGuid"));

            Set("accountPosition", 0.ToString());
            try
            {
                var moneySpentItem = new MoneySpentItemDto()
                {
                    ItemCost = itemCost, ItemName = itemName, DateTime = dateTime
                };
                _userApiService.CreateMoneySpentItem(accountGuid, moneySpentItem);
                return(LoadAccountView(accountGuid, String.Empty));
            }
            catch (Exception e)
            {
                return(LoadAccountView(accountGuid, e.Message));
            }
        }