public IActionResult AddMoney(MoneyEarned money) { if (money.Amount < 0) { return(Json(new { money = "error" })); } MaaserRepository rep = new MaaserRepository(_connString, User.Identity.Name); rep.AddAmount(money); var total = rep.GetStillOwe(); return(Json(new { money, total })); //return Json(money); }
private void EarnMoney(int amount, int price) { var moneyEarned = amount * price; MoneyEarned?.Invoke(moneyEarned); }