Browse Source

reset password

feature/19315_Customer-Registration-new
shakun 11 months ago
parent
commit
64192b1c24
  1. 17
      CustomerOnlineV2/CustomerOnlineV2.Business/Business/AccountBusiness/AccountBusiness.cs
  2. 2
      CustomerOnlineV2/CustomerOnlineV2/Views/Account/Index.cshtml
  3. 4
      CustomerOnlineV2/CustomerOnlineV2/Views/Transaction/SendMoney.cshtml

17
CustomerOnlineV2/CustomerOnlineV2.Business/Business/AccountBusiness/AccountBusiness.cs

@ -6,6 +6,7 @@ using CustomerOnlineV2.Repository.Repository.AccountRepository;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using System.Text;
using System.Web.Helpers;
using static CustomerOnlineV2.Common.Models.Notification.PasswordGenerator;
namespace CustomerOnlineV2.Business.Business.AccountBusiness
@ -40,7 +41,16 @@ namespace CustomerOnlineV2.Business.Business.AccountBusiness
//var randomPassword = PasswordGenerator.GenerateRandomPassword();
//model.RandomPassword = randomPassword;
var chars = "0123456789";
var random = new Random();
var result = new string(Enumerable.Repeat(chars, 6).Select(s => s[random.Next(s.Length)]).ToArray());
string random_num = result.ToString();
model.RandomPassword = random_num;
List<Mapping> bodyMappings = new List<Mapping>();
bodyMappings.Add(new Mapping() { SValue = "CustomerName", SText = logindetails.FullName });
bodyMappings.Add(new Mapping() { SValue = "PASS_WORD", SText = random_num });
bodyMappings.Add(new Mapping() { SValue = "EMAIL_ID", SText = logindetails.Email });
SendNotificationRequest request = new SendNotificationRequest()
{
IsBulkNotification = false,
@ -48,13 +58,13 @@ namespace CustomerOnlineV2.Business.Business.AccountBusiness
//ProcessId = processId,
ProviderId = "ResetPassword",
NotificationTypeId = NOTIFICATION_TYPE.EMAIL.ToString(),
//Template = Common.Model.Enum.NotifyTemplate.RESET_PASSWORD_EMAIL,
Template = NotifyTemplate.RESET_PASSWORD_EMAIL,
Recipients = new List<RecipientViewModel>()
{
new RecipientViewModel()
{
NotificationContent = new NotificationDTO() {
// Body = JsonConvert.SerializeObject(bodyMappings),
Body = JsonConvert.SerializeObject(bodyMappings),
//Title will be set by mapping json
},
Address= model.Username
@ -63,6 +73,9 @@ namespace CustomerOnlineV2.Business.Business.AccountBusiness
};
_logger.LogDebug("PasswordReset.EMAIL | REQUEST : " + JsonConvert.SerializeObject(request));
var jsonRx1 = NotifierV2.SendNotification(request, NOTIFICATION_TYPE.EMAIL);
_logger.LogDebug("PasswordReset.EMAIL | RESPONSE : " + JsonConvert.SerializeObject(jsonRx1));
return await _accountRepo.PasswordReset(model, logindetails);
}

2
CustomerOnlineV2/CustomerOnlineV2/Views/Account/Index.cshtml

@ -97,7 +97,7 @@
</div>
</div>
</form>
<div class="col-sm text-left mt-3">Forgot Password ? <a class="" href="/Account/ResetPassword">You can reset your passowrd right away</a></div>
<div class="col-sm text-left mt-3">Forgot Password ? <a class="" href="/Account/ResetPassword">You can reset your password right away</a></div>
<div class="text-5 text-left mt-5">Don't have an user ? </div>
<div class="mt-3"> Registration won't take more than 5 min, <a class="" href="/Customer/CustomerRegistration">Register Now</a></div>
</div>

4
CustomerOnlineV2/CustomerOnlineV2/Views/Transaction/SendMoney.cshtml

@ -186,7 +186,7 @@
<tr>
<td> Payout Amount :</td>
<td>
<strong><span id="payoutAmount">0.00 <label id="pCurrency">XXX</label></span></strong>
<strong><span id="payoutAmount">0.00 </span>&nbsp;<label id="pCurrency">XXX</label></strong>
</td>
</tr>
@ -245,7 +245,7 @@
$('#PayoutAmount').on('change', function () {
if (!isNaN(parseFloat($(this).val())) && parseFloat($(this).val()) > 0) {
$('#hdnCalcBy').val('c');
$('#hdnCalcBy').val('p');
}
});

Loading…
Cancel
Save