Exemplo n.º 1
0
        public static bool DepositCash(string amount)
        {
            var cleanAmount = StringHelper.CleanInput(amount);

            if (!Validation.IsValidTransactionAmt(cleanAmount))
            {
                return(false);
            }

            Amount = cleanAmount;

            var amt           = decimal.Parse(Amount, NumberStyles.Currency);
            var dataInterface = new DataInterface();

            // AddTransaction will return bool based on insert success / fail
            var output = dataInterface.AddTransaction('D', amt);

            if (output)
            {
                Validation.RenderSuccess($"Deposit of {amt.ToString("C")} was successful!  Press any key to continue.");
                Console.ReadLine();
                return(true);
            }

            Validation.RenderError("We ran into an error trying to make the deposit.");
            return(false);
        }