public ActionResult <decimal> RequestTransfer(Transfer transfer)
        {
            Account someone = accountDAO.GetAccountInfoById(transfer.UserFromId);
            Account me      = accountDAO.GetAccountInfoById(transfer.UserToId);

            if (someone.AccountId == 0)
            {
                return(NotFound());
            }
            return(requestDAO.RequestTransfer(transfer.Amount, someone, me));
        }
Exemple #2
0
        public ActionResult <decimal> TransferFunds(Transfer transfer)
        {
            Account sender   = accountDAO.GetAccountInfoById(transfer.UserFromId);
            Account receiver = accountDAO.GetAccountInfoById(transfer.UserToId);

            if (receiver.AccountId == 0)
            {
                return(NotFound());
            }

            return(transferDAO.MakeTransfer(transfer.Amount, sender, receiver));
        }
Exemple #3
0
 public Account GetMyAccountBalance()
 {
     return(accountDAO.GetAccountInfoById((int)GetCurrentUserId()));
 }