Ejemplo n.º 1
0
        private bool isValidTransfer(decimal max)
        {
            string temp = tbAmount.Text;

            return(Validator.IsPresent(temp) &&
                   Validator.IsDecimal(temp) &&
                   Validator.IsInRange(Convert.ToDecimal(temp), 0.00m, max));
        }
Ejemplo n.º 2
0
 private decimal withdrawalProcess(decimal withdrawal, decimal fromAccount)
 {
     if (Validator.IsInRange(withdrawal, 0.00m, fromAccount))
     {
         return(Math.Round((fromAccount -= withdrawal), 2, MidpointRounding.AwayFromZero));
     }
     else
     {
         errorMessage("Incorrect amount to withdraw. Please try again.");
         return(fromAccount);
     }
 }