Browse Source

#19922 chnages for refer and earn module

feature/19315_Customer-Registration
Leeza Baidar 12 months ago
parent
commit
3c9cb35557
  1. 1
      CustomerOnlineV2/CustomerOnlineV2.Business/Business/RegisterBusiness/IRegisterBusiness.cs
  2. 8
      CustomerOnlineV2/CustomerOnlineV2.Business/Business/RegisterBusiness/RegisterBusiness.cs
  3. 2
      CustomerOnlineV2/CustomerOnlineV2.Common/Models/AccountModel/AccountModel.cs
  4. 3
      CustomerOnlineV2/CustomerOnlineV2.Common/Models/HomeModel/HomeModel.cs
  5. 1
      CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/RegisterRepository/IRegisterRepository.cs
  6. 72
      CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/RegisterRepository/RegisterRepository.cs
  7. 15
      CustomerOnlineV2/CustomerOnlineV2/Controllers/CustomerController.cs
  8. 2
      CustomerOnlineV2/CustomerOnlineV2/Views/Customer/Notifications.cshtml
  9. 212
      CustomerOnlineV2/CustomerOnlineV2/Views/Customer/Refer.cshtml
  10. 14
      CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout.cshtml
  11. 5
      CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout2.cshtml
  12. 6
      CustomerOnlineV2/CustomerOnlineV2/wwwroot/css/styles-login.css
  13. 4
      CustomerOnlineV2/CustomerOnlineV2/wwwroot/css/styles.css
  14. BIN
      CustomerOnlineV2/CustomerOnlineV2/wwwroot/images/refer.png

1
CustomerOnlineV2/CustomerOnlineV2.Business/Business/RegisterBusiness/IRegisterBusiness.cs

@ -15,5 +15,6 @@ namespace CustomerOnlineV2.Business.Business.RegisterBusiness
Task<CommonResponse> AddCustomers(OnlineCustomerRegisterModel register);
Task<AddressListResponse> GetAddressList(AddressRequest addressRequest);
Task<CustomerNotificationModel> GetAllNotificationDetails(LoginResponse loginDetails);
Task<CustomerNotificationModel> GetRewardPoints(LoginResponse loginDetails);
}
}

8
CustomerOnlineV2/CustomerOnlineV2.Business/Business/RegisterBusiness/RegisterBusiness.cs

@ -19,7 +19,7 @@ namespace CustomerOnlineV2.Business.Business.RegisterBusiness
private readonly ITPApiService _tpApi;
private readonly IRegisterRepository _registerRepository;
@ -44,5 +44,11 @@ namespace CustomerOnlineV2.Business.Business.RegisterBusiness
{
return (CustomerNotificationModel)await _registerRepository.GetAllNotificationDetails(loginDetails);
}
public async Task<CustomerNotificationModel> GetRewardPoints(LoginResponse loginDetails)
{
return (CustomerNotificationModel)await _registerRepository.GetRewardPoints(loginDetails);
}
}
}

2
CustomerOnlineV2/CustomerOnlineV2.Common/Models/AccountModel/AccountModel.cs

@ -42,5 +42,7 @@ namespace CustomerOnlineV2.Common.Models.AccountModel
public bool ForceChangePassword { get; set; }
public string? GoogleAuthCode { get; set; }
public string? SessionId { get; set; }
public string? RewardPoints { get; set; }
public string? MembershipId { get; set; }
}
}

3
CustomerOnlineV2/CustomerOnlineV2.Common/Models/HomeModel/HomeModel.cs

@ -85,6 +85,9 @@
public string? url { get; set; }
public string? IsClickable { get; set; }
public string? notificationCount { get; set;}
public string? RewardPoints { get; set;}
public string? MembershipId { get; set; }
public string? CustomerName { get; set; }
}
public class CustomerNotificationModel : CommonResponse

1
CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/RegisterRepository/IRegisterRepository.cs

@ -15,5 +15,6 @@ namespace CustomerOnlineV2.Repository.Repository.RegisterRepository
Task<CommonResponse> AddRegisterDetails(OnlineCustomerRegisterModel register);
// Task<CommonResponse> AddRegisterDetails(LoginResponse loginDetails);
Task<CustomerNotificationModel> GetAllNotificationDetails(LoginResponse loginDetails);
Task<CustomerNotificationModel> GetRewardPoints(LoginResponse loginDetails);
}
}

72
CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/RegisterRepository/RegisterRepository.cs

@ -148,5 +148,77 @@ namespace CustomerOnlineV2.Repository.Repository.RegisterRepository
}
return await Task.FromResult(_response);
}
public async Task<CustomerNotificationModel> GetRewardPoints(LoginResponse loginDetails)
{
CustomerNotificationModel _response = new CustomerNotificationModel();
try
{
var sql = "EXEC mobile_proc_customerMaster";
sql += " @Flag = " + _connHelper.FilterString("get-invite-details");
// sql += ",@User = " + _connHelper.FilterString(loginDetails.UserName);
sql += ",@sourceCustomerId = " + _connHelper.FilterString(loginDetails.UserId);
_logger.LogDebug("HOMEREPOSITORY | GETREWARDPOINTS | SQL | " + sql);
var dt = _connHelper.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count <= 0)
{
_response.ResponseCode = ResponseHelper.FAILED;
_response.ResponseMessage = "DB Null Error!";
_logger.LogError("HOMEREPOSITORY | GETREWARDPOINTS | DB RESPONSE | " + JsonConvert.SerializeObject(_response));
}
else
{
//_response.ResponseCode = Convert.ToInt16(dt.Rows[0]["errorCode"]);
//_response.ResponseMessage = Convert.ToString(dt.Rows[0]["msg"]);
List<NotificationModel> obj = new List<NotificationModel>();
//if(dt.Rows.Count > 1)
//{
// var item = dt.Rows[1];
// obj.Add(new NotificationModel
// {
// Title = Convert.ToString(item["REWARD_TYPE"]),
// RewardPoints = Convert.ToString(item["REWARD_AMOUNT"]),
// CustomerName = Convert.ToString(item["CUSTOMER_NAME"]),
// Date = Convert.ToString(item["CREATED_DATE"]),
// });
//}
//else
//{
// _response.ResponseMessage = "Error";
//}
foreach (DataRow item in dt.Rows)
{
obj.Add(new NotificationModel
{
//Id = Convert.ToString(item["rowId"]),
Title = Convert.ToString(item["REWARD_TYPE"]),
RewardPoints = Convert.ToString(item["REWARD_AMOUNT"]),
CustomerName = Convert.ToString(item["CUSTOMER_NAME"]),
Date = Convert.ToString(item["CREATED_DATE"]),
//IsRead = Convert.ToString(item["isRead"]),
//Type = Convert.ToString(item["type"]),
//SentId = Convert.ToString(item["sentId"]),
// Category = Convert.ToString(item["category"]),
//url = Convert.ToString(item["url"]),
//IsClickable = Convert.ToString(item["isClickable"])
// notificationCount = Convert.ToString(item["notificationCount"])
});
}
_response.NotificationModel = obj;
}
}
catch (Exception ex)
{
_response.ResponseCode = ResponseHelper.EXCEPTION;
_response.ResponseMessage = "Exception occured: " + ex.Message;
_logger.LogError("HOMEREPOSITORY | GETREWARDPOINTS | EXCEPTION | " + JsonConvert.SerializeObject(_response));
}
return await Task.FromResult(_response);
}
}
}

15
CustomerOnlineV2/CustomerOnlineV2/Controllers/CustomerController.cs

@ -95,5 +95,20 @@ namespace CustomerOnlineV2.Controllers
return await _registerBusiness.GetAllNotificationDetails(loginDetails);
}
[Authorization("Refer")]
public IActionResult Refer()
{
return View();
}
[HttpGet]
[Route("GetRewardDetails")]
public async Task<CustomerNotificationModel> GetRewardDetails()
{
var loginDetails = HttpContext.GetLoginDetails();
return await _registerBusiness.GetRewardPoints(loginDetails);
}
}
}

2
CustomerOnlineV2/CustomerOnlineV2/Views/Customer/Notifications.cshtml

@ -115,7 +115,6 @@
});
function getNotificationDetails() {
debugger
$.ajax({
type: 'POST',
// url: '/ReceiverInformation/GetAllReceiver',
@ -141,7 +140,6 @@
}
function PopulateNotifications(response) {
debugger
var result = response.notificationModel;
console.log('Received response:', result);

212
CustomerOnlineV2/CustomerOnlineV2/Views/Customer/Refer.cshtml

@ -0,0 +1,212 @@
@using CustomerOnlineV2.Common.Helper
@{
Layout = "_Layout2";
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
.nav .nav-item {
margin-right: 10px !important;
}
.col-md-3 {
flex: 0 0 auto !important;
width: 100% !important;
}
.nav {
padding-bottom: 8px !important;
}
.img-fluid {
max-width: 302px;
height: 300px;
}
.btn-primary {
background-color:#262262 !important;
border-color: #262262 !important;
}
p {
line-height: 1.8 !important;
font-size: 18px !important;
}
.banner .banner-small {
height: 445px !important;
border-radius: 8px !important;
padding: 50px 20px !important;
margin-bottom: 24px !important;
position: relative !important;
}
#referImg{
text-align: right;
}
#reward-table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
#reward-table th, #reward-table td {
padding: 12px;
text-align: left;
border: 1px solid #ddd;
}
#reward-table tbody tr:nth-child(even) {
background-color: #f9f9f9;
}
#reward-table tbody tr:hover {
background-color: #f1f1f1;
}
.banner-small-2 {
display: flex;
justify-content: space-between;
align-items: center;
}
.banner-small-2 .img-fluid {
margin-left: 20px;
padding-right: 100px;
}
.banner-small-2 .text-content {
width: 60%;
}
</style>
<script src="~/vendor/jquery/jquery.min.js"></script>
</head>
<body>
<!-- Content -->
<div id="content" class=" py-4 section-form-bg">
<div class="container">
<div class="row">
<!-- Middle Panel -->
<div class="col-lg-12">
<div class="mb-4">
<h3 class="fw-400">Refer and get exciting offers !</h3>
<p>More referrals, more money</p>
</div>
<div class="card">
<div class="card-body p-4">
<div>
<ul class="nav nav-pills">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#" id="invite-tab">Invite</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#" id="referrals-tab" onclick="GetRewardDetails()">Referrals</a>
</li>
</ul>
</div>
<div class="row mb-4">
<div class="col-md-3 banner">
<div id="invite-content">
<div class="banner-small banner-small-2 bg-2 d-flex align-items-center flex-direction-column">
<div class="col-md-6">
<h3>Refer &amp; Earn</h3>
<p class="text-black fs-5">Receive a FREE 5$ bonus credit as Reward Amount</p>
<p>You and your friend will each be given 5$ in bonus credit. Get 1$ after they successfully register, and 4$ after their first transaction.</p>
@* <p>Get 1$ after they successfully register, and 4$ after their first transaction.</p> *@
<p>There may be minimum send requirements, Terms and Conditions.</p>
<p class="text-black fs-5">Refer IME Londong to your friends &amp; get many more exciting deals <br> plus discount on your every transfer.</p>
</div>
<div class="col-md-4" id="referImg">
<img src="~/images/refer.png" alt="Image Description" class="img-fluid" />
</div>
</div>
</div>
<div id="referrals-content" style="display: none;">
<table id="reward-table" class="table">
<thead>
<tr>
<th>Reward Type</th>
<th>Reward Amount</th>
<th>Customer Name</th>
<th>Created Date</th>
</tr>
</thead>
<tbody id="reward-table-body">
</tbody>
</table>
</div>
<div class="col-md-12">
<div class="mb-3 mt-5">
<button class="btn btn-lg btn-primary">Send Invite <i class="fa fa-share-alt px-1" aria-hidden="true"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Content end -->
</body>
</html>
<script src="~/lib/jquery/dist/jquery.min.js"></script>
@section scripts{
<script>
$(document).ready(function () {
$('#invite-content').show();
$('#referrals-content').hide();
$('#invite-tab').click(function () {
$('#invite-content').show();
$('#referrals-content').hide();
});
$('#referrals-tab').click(function () {
// debugger
//GetRewardDetails();
$('#invite-content').hide();
$('#referrals-content').show();
});
});
function GetRewardDetails() {
$.ajax({
type: 'GET',
contentType: 'application/json; charset=utf-8',
url: '/GetRewardDetails',
data: {},
success: function (response) {
var data = response.notificationModel;
var tableBody = $('#reward-table-body');
tableBody.empty();
data.forEach(function (item) {
var row = '<tr>' +
'<td>' + item.title + '</td>' +
'<td>' + item.rewardPoints + '</td>' +
'<td>' + item.customerName + '</td>' +
'<td>' + item.date + '</td>' +
'</tr>';
tableBody.append(row);
});
},
error: function (error) {
console.error(error);
}
});
}
</script>
}

14
CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout.cshtml

@ -173,7 +173,7 @@
<h3 class="text-5 fw-400 my-4">Refer a Friend</h3>
<p class="text-muted opacity-8 mb-4">Refer a Friend and Earn Rewards!</p>
<div class="d-grid">
<a href="refer.html" class="text-3">Refer a Friend</a>
<a href="/Customer/Refer" class="text-3">Refer a Friend</a>
</div>
</div>
<!-- Need Help? End -->
@ -228,7 +228,7 @@
});
function GetNotificationList() {
debugger
$.ajax(
{
type: 'POST',
@ -241,8 +241,6 @@
},
async: false,
success: function (response) {
debugger
debugger
if (response.responseCode != 0) {
ShowAlertMessage(response.responseCode, response.responseMessage);
}
@ -290,16 +288,8 @@
}
}
</script>
@await RenderSectionAsync("Scripts", required: false)
</body>
</html>
@section Scripts{
<script type="text/javascript">
</script>
}

5
CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout2.cshtml

@ -174,7 +174,7 @@
});
function GetNotificationList() {
debugger
$.ajax(
{
type: 'POST',
@ -187,8 +187,7 @@
},
async: false,
success: function (response) {
debugger
debugger
if (response.responseCode != 0) {
ShowAlertMessage(response.responseCode, response.responseMessage);
}

6
CustomerOnlineV2/CustomerOnlineV2/wwwroot/css/styles-login.css

@ -2599,7 +2599,9 @@ hr {
}
/* Nav */
.nav .nav-item .nav-link {
color: #444;
color: #444;
background-color: #262262;
color: white;
}
.nav.nav-light .nav-item .nav-link {
@ -4556,7 +4558,7 @@ a.bg-primary:focus, a.bg-primary:hover, button.bg-primary:focus, button.bg-prima
background-color: $background-bg-5;
}
.banner .banner-small {
height: 350px;
height: 445px;
border-radius: 8px;
padding: 50px 20px;
margin-bottom: 24px;

4
CustomerOnlineV2/CustomerOnlineV2/wwwroot/css/styles.css

@ -2588,7 +2588,9 @@ hr {
}
/* Nav */
.nav .nav-item .nav-link {
color: #444;
color: #444;
background-color: #262262;
color: white;
}
.nav.nav-light .nav-item .nav-link {

BIN
CustomerOnlineV2/CustomerOnlineV2/wwwroot/images/refer.png

After

Width: 462  |  Height: 644  |  Size: 40 KiB

Loading…
Cancel
Save