Browse Source

#22654 Filter receiver by paymentmethod

feature/19315_Customer-Registration-new
Dinesh 10 months ago
parent
commit
8dd5317d8a
  1. 1
      CustomerOnlineV2/CustomerOnlineV2.Business/Business/TransactionBusiness/ITransactionBusiness.cs
  2. 5
      CustomerOnlineV2/CustomerOnlineV2.Business/Business/TransactionBusiness/TransactionBusiness.cs
  3. 1
      CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/TransactionRepository/ITransactionRepository.cs
  4. 40
      CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/TransactionRepository/TransactionRepository.cs
  5. 8
      CustomerOnlineV2/CustomerOnlineV2/Controllers/TransactionController.cs
  6. 51
      CustomerOnlineV2/CustomerOnlineV2/Views/Transaction/SendMoney.cshtml

1
CustomerOnlineV2/CustomerOnlineV2.Business/Business/TransactionBusiness/ITransactionBusiness.cs

@ -19,5 +19,6 @@ namespace CustomerOnlineV2.Business.Business.TransactionBusiness
Task<CustomerNotificationModel> GetRewardPoints(LoginResponse loginDetails);
Task<SendMoneySuccessModel> UpdateTranDataFailed(TrustPaymentRequest request, LoginResponse loginDetails);
Task<ReceiverListModel> GetReceiverListDetail(LoginResponse loginDetails , string receiverId);
Task<CommonDropDownList> GetReceiverListDDL(CommonDropDownModel model, LoginResponse loginDetails);
}
}

5
CustomerOnlineV2/CustomerOnlineV2.Business/Business/TransactionBusiness/TransactionBusiness.cs

@ -376,5 +376,10 @@ namespace CustomerOnlineV2.Business.Business.TransactionBusiness
{
return await _transactionRepo.GetReceiverListDetail(loginDetails , receiverId);
}
public async Task<CommonDropDownList> GetReceiverListDDL(CommonDropDownModel model, LoginResponse loginDetails)
{
return await _transactionRepo.GetReceiverListDDL(model, loginDetails);
}
}
}

1
CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/TransactionRepository/ITransactionRepository.cs

@ -17,5 +17,6 @@ namespace CustomerOnlineV2.Repository.Repository.TransactionRepository
Task<CustomerNotificationModel> GetRewardPoints(LoginResponse loginDetails);
Task<SendMoneySuccessModel> UpdateTranDataFailed(TrustPaymentRequest request, LoginResponse loginDetails);
Task<ReceiverListModel> GetReceiverListDetail(LoginResponse loginDetails, string receiverId);
Task<CommonDropDownList> GetReceiverListDDL(CommonDropDownModel model, LoginResponse loginDetails);
}
}

40
CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/TransactionRepository/TransactionRepository.cs

@ -633,6 +633,46 @@ namespace CustomerOnlineV2.Repository.Repository.TransactionRepository
}
return await Task.FromResult(_response);
}
public async Task<CommonDropDownList> GetReceiverListDDL(CommonDropDownModel model, LoginResponse loginDetails)
{
try
{
var sql = "EXEC PROC_DROPDOWN_LIST";
sql += " @Flag = " + _connHelper.FilterString("receiverListPMode");
sql += ",@customerid = " + _connHelper.FilterString(loginDetails.UserId);
sql += " ,@selectedValue1 = " + _connHelper.FilterString(model.country);
sql += " ,@paymentMode = " + _connHelper.FilterString(model.Value);
_logger.LogDebug("TRANSACTIONREPOSITORY | GETRECEIVERLISTDDL | SQL | " + sql);
var dt = _connHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
{
return new CommonDropDownList();
}
List<DropDownResponse> _resp = new List<DropDownResponse>();
foreach (DataRow item in dt.Rows)
{
_resp.Add(new DropDownResponse
{
Id = Utilities.GetRowCellValue(item["Id"]),
Text = Utilities.GetRowCellValue(item["Text"])
});
}
return new CommonDropDownList { DropDownResponse = _resp };
}
catch (Exception ex)
{
_logger.LogError("TRANSACTIONREPOSITORY | GETRECEIVERLISTDDL | " + ex.Message);
return new CommonDropDownList { DropDownResponse = new List<DropDownResponse>() };
}
}
}
}

8
CustomerOnlineV2/CustomerOnlineV2/Controllers/TransactionController.cs

@ -313,5 +313,13 @@ namespace CustomerOnlineV2.Controllers
var loginDetails = HttpContext.GetLoginDetails();
return await _transactionBusiness.GetReceiverListDetail(loginDetails, id);
}
[HttpPost]
[ValidateAntiForgeryToken]
[Authorization("GetReceiverListDDL")]
public async Task<CommonDropDownList> GetReceiverListDDL(CommonDropDownModel model)
{
var loginDetails = HttpContext.GetLoginDetails();
return await _transactionBusiness.GetReceiverListDDL(model, loginDetails);
}
}
}

51
CustomerOnlineV2/CustomerOnlineV2/Views/Transaction/SendMoney.cshtml

@ -309,10 +309,25 @@
$('#ReceivingCountry').change(function () {
if ($(this).val() != '') {
PopulateDDL('DeliveryMethod', 'pMode', $(this).val(), true, '');
PopulateDDL('Receiver', 'receiverList', $(this).val(), true, '');
// PopulateDDL('Receiver', 'receiverList', $(this).val(), true, '');
}
else {
$('#DeliveryMethod').empty();
//$('#Receiver').empty();
}
});
$('#DeliveryMethod').change(function () {
if ($(this).val() != '') {
PopulateReceiverListDDL();
}
else {
$('#Receiver').empty();
}
});
@ -745,5 +760,39 @@
});
}
function PopulateReceiverListDDL() {
let pmode = $('#DeliveryMethod option:selected').val();
let pCountryid = $('#ReceivingCountry option:selected').val();
let Data = {
Flag: 'receiverListPMode',
Country: pCountryid,
Value: pmode,
};
$.ajax(
{
type: 'POST',
url: '/Transaction/GetReceiverListDDL',
data: Data,
headers: {
"RequestVerificationToken":
$('input[name="__RequestVerificationToken"]').val()
},
async: false,
success: function (response) {
PopulateDDLMain(response, 'Receiver', true, '');
},
error: function () {
return null;
}
});
}
</script>
}
Loading…
Cancel
Save