public bool NewPayment(int cardId, string account, decimal money, string notice) { if (!cardDao.CheckEnoughMoney(cardId, money)) { return(false); } else { Payment payment = new Payment(); payment.CardId = cardId; payment.Account = account; payment.Date = DateTime.Now; payment.Money = money; payment.Notice = notice; paymentDao.AddPayment(payment); cardDao.UpdateBalance(cardId, money * -1); cardDao.UpdateBalance(account, money); return(true); } }