public async Task <IActionResult> PostRechargeAccount([FromBody] AccountMoney value) { if (BUS_Controls.Controls.rechargeAccount(value)) { return(new JsonResult(new ApiResponse <object>("recharge ok"))); } return(new JsonResult(new ApiResponse <object>(200, "recharge fail"))); }
private async void rechargeAccount_Click(object sender, RoutedEventArgs e) { CustomerWindow.Instance.startWaitting(); RechargeWindow recharge = new RechargeWindow(); recharge.WindowStartupLocation = WindowStartupLocation.CenterOwner; Nullable <bool> dialogResult = recharge.ShowDialog(); if (dialogResult == true) { AccountMoney moneyAdd = new AccountMoney(); moneyAdd.UserId = AuthenticatedUser.user.UserId; moneyAdd.moneyAdd = recharge.money; Response <object> response = await APIHelper.Instance.Post <Response <object> > (ApiRoutes.Account.rechargeAccount, moneyAdd); } CustomerWindow.Instance.endWatting(); }