public async Task <BalanceRequestResponse> DeductWalletBalanceRequest(int requestInitiatorId, decimal amount, string comment) { BalanceRequestResponse response = new BalanceRequestResponse(); response = await _common.DeductWalletBalanceRequest(requestInitiatorId, amount, comment); return(response); }
public IResponse createSuccessResponse(PersonEN person) { BalanceRequestResponse response = new BalanceRequestResponse(); try { response.MasterEmail = person.EmailMaster; response.MasterName = person.PersonMaster; response.Status = true; } catch (Exception ex) { Console.WriteLine(ex.InnerException); } return(response); }
public async Task <BalanceRequestResponse> DeductWalletBalanceRequest(int request_initiator_id, decimal amount, string comment) { BalanceRequestResponse walletWidthdrawalResponse = new BalanceRequestResponse(); Console.WriteLine("Connect to SQL Server and demo Create, Read, Update and Delete operations."); Console.Write("Connecting to SQL Server ... "); using (SqlConnection connection = new SqlConnection(this._connectionString)) { connection.Open(); Console.WriteLine("Done."); using (SqlCommand command = new SqlCommand("deduct_balance_request", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.Add("@request_initiator_id", SqlDbType.Int).Value = request_initiator_id; command.Parameters.Add("@comment", SqlDbType.NVarChar).Value = comment; command.Parameters.Add("@amount", SqlDbType.Decimal).Value = amount; command.Parameters.Add("@widthdrawal_amount", SqlDbType.Decimal, 123); command.Parameters["@widthdrawal_amount"].Direction = ParameterDirection.Output; command.Parameters.Add("@return_message", SqlDbType.NVarChar, 1233232); command.Parameters["@return_message"].Direction = ParameterDirection.Output; try { await command.ExecuteNonQueryAsync(); { walletWidthdrawalResponse.amount_requested = (decimal)command.Parameters["@widthdrawal_amount"].Value; walletWidthdrawalResponse.message = (string)command.Parameters["@return_message"].Value; } } catch (Exception ex) { throw ex; } } } Console.WriteLine("All done. Press any key to finish..."); return(walletWidthdrawalResponse); }
public async Task <ActionResult> DeductWalletBalanceRequest(int requestInitiatorId, decimal amount, string comment) { BalanceRequestResponse response = await rs.DeductWalletBalanceRequest(requestInitiatorId, amount, comment); return(Ok(response)); }