Browse Source

#20532 updated

feature/19315_Customer-Registration
Leeza Baidar 11 months ago
parent
commit
d302f92dc3
  1. 74
      CustomerOnlineV2/CustomerOnlineV2.Business/Business/AccountBusiness/AccountBusiness.cs
  2. 89
      CustomerOnlineV2/CustomerOnlineV2.Business/Business/RegisterBusiness/RegisterBusiness.cs
  3. 12
      CustomerOnlineV2/CustomerOnlineV2/Controllers/AccountController.cs

74
CustomerOnlineV2/CustomerOnlineV2.Business/Business/AccountBusiness/AccountBusiness.cs

@ -142,43 +142,43 @@ namespace CustomerOnlineV2.Business.Business.AccountBusiness
_logger.LogDebug("SubmitOTP | DB RESPONSE : " + JsonConvert.SerializeObject(jsonRx));
if (jsonRx.ErrorCode.Equals("0"))
{
List<Mapping> bodyMappings = new List<Mapping>();
bodyMappings.Add(new Mapping() { SValue = "CustomerName", SText = loginDetails.FullName });
bodyMappings.Add(new Mapping() { SValue = "CustomerId", SText = loginDetails.MembershipId.ToString() });
bodyMappings.Add(new Mapping() { SValue = "UserId", SText = loginDetails.MembershipId });
bodyMappings.Add(new Mapping() { SValue = "FirstName", SText = loginDetails.FullName });
bodyMappings.Add(new Mapping() { SValue = "MiddleName", SText = loginDetails.FullName });
bodyMappings.Add(new Mapping() { SValue = "LastName", SText = loginDetails.FullName });
bodyMappings.Add(new Mapping() { SValue = "MobileNo", SText = loginDetails.MobileNumber });
bodyMappings.Add(new Mapping() { SValue = "Address", SText = loginDetails.UserName });
bodyMappings.Add(new Mapping() { SValue = "EMAIL_ID", SText = loginDetails.Email });
bodyMappings.Add(new Mapping() { SValue = "RegisteredDate", SText = "" });
SendNotificationRequest request = new SendNotificationRequest()
{
IsBulkNotification = false,
UserName = loginDetails.Email,
ProviderId = "BasicRegistration",
NotificationTypeId = NOTIFICATION_TYPE.EMAIL.ToString(),
Template = NotifyTemplate.BASIC_REGISTRATION_EMAIL,
Recipients = new List<RecipientViewModel>()
{
new RecipientViewModel()
{
NotificationContent = new NotificationDTO() {
Body = JsonConvert.SerializeObject(bodyMappings),
//Title will be set by mapping json
},
Address= loginDetails.Email
}
}
};
jsonRx = NotifierV2.SendNotification(request, NOTIFICATION_TYPE.EMAIL);
}
//if (jsonRx.ErrorCode.Equals("0"))
//{
// List<Mapping> bodyMappings = new List<Mapping>();
// bodyMappings.Add(new Mapping() { SValue = "CustomerName", SText = loginDetails.FullName });
// bodyMappings.Add(new Mapping() { SValue = "CustomerId", SText = loginDetails.MembershipId.ToString() });
// bodyMappings.Add(new Mapping() { SValue = "UserId", SText = loginDetails.MembershipId });
// bodyMappings.Add(new Mapping() { SValue = "FirstName", SText = loginDetails.FullName });
// bodyMappings.Add(new Mapping() { SValue = "MiddleName", SText = loginDetails.FullName });
// bodyMappings.Add(new Mapping() { SValue = "LastName", SText = loginDetails.FullName });
// bodyMappings.Add(new Mapping() { SValue = "MobileNo", SText = loginDetails.MobileNumber });
// bodyMappings.Add(new Mapping() { SValue = "Address", SText = loginDetails.UserName });
// bodyMappings.Add(new Mapping() { SValue = "EMAIL_ID", SText = loginDetails.Email });
// bodyMappings.Add(new Mapping() { SValue = "RegisteredDate", SText = "" });
// SendNotificationRequest request = new SendNotificationRequest()
// {
// IsBulkNotification = false,
// UserName = loginDetails.Email,
// ProviderId = "BasicRegistration",
// NotificationTypeId = NOTIFICATION_TYPE.EMAIL.ToString(),
// Template = NotifyTemplate.BASIC_REGISTRATION_EMAIL,
// Recipients = new List<RecipientViewModel>()
// {
// new RecipientViewModel()
// {
// NotificationContent = new NotificationDTO() {
// Body = JsonConvert.SerializeObject(bodyMappings),
// //Title will be set by mapping json
// },
// Address= loginDetails.Email
// }
// }
// };
// jsonRx = NotifierV2.SendNotification(request, NOTIFICATION_TYPE.EMAIL);
//}
//return jsonRx;
return await Task.FromResult(jsonRx);

89
CustomerOnlineV2/CustomerOnlineV2.Business/Business/RegisterBusiness/RegisterBusiness.cs

@ -37,53 +37,52 @@ namespace CustomerOnlineV2.Business.Business.RegisterBusiness
public async Task<JsonRxResponse> AddCustomers(OnlineCustomerRegisterModel register)
{
var model1 = await _registerRepository.AddRegisterDetails(register);
return model1;
//try
//{
// if (model1.ErrorCode.Equals("0"))
// {
// List<Mapping> bodyMappings = new List<Notify.Mapping>();
try
{
if (model1.ErrorCode.Equals("0"))
{
List<Mapping> bodyMappings = new List<Notify.Mapping>();
// bodyMappings.Add(new Mapping() { SValue = "CustomerName", SText = register.fullName });
// bodyMappings.Add(new Mapping() { SValue = "CustomerId", SText = "" });
// bodyMappings.Add(new Mapping() { SValue = "UserId", SText = register.membershipId });
// bodyMappings.Add(new Mapping() { SValue = "FirstName", SText = register.firstName });
// bodyMappings.Add(new Mapping() { SValue = "MiddleName", SText = register.middleName });
// bodyMappings.Add(new Mapping() { SValue = "LastName", SText = register.lastName1 });
// bodyMappings.Add(new Mapping() { SValue = "MobileNo", SText = register.mobile });
// bodyMappings.Add(new Mapping() { SValue = "Address", SText = register.address });
// bodyMappings.Add(new Mapping() { SValue = "EMAIL_ID", SText = register.email });
// bodyMappings.Add(new Mapping() { SValue = "RegisteredDate", SText = "" });
bodyMappings.Add(new Mapping() { SValue = "CustomerName", SText = register.fullName });
bodyMappings.Add(new Mapping() { SValue = "CustomerId", SText = "" });
bodyMappings.Add(new Mapping() { SValue = "UserId", SText = register.membershipId });
bodyMappings.Add(new Mapping() { SValue = "FirstName", SText = register.firstName });
bodyMappings.Add(new Mapping() { SValue = "MiddleName", SText = register.middleName });
bodyMappings.Add(new Mapping() { SValue = "LastName", SText = register.lastName1 });
bodyMappings.Add(new Mapping() { SValue = "MobileNo", SText = register.mobile });
bodyMappings.Add(new Mapping() { SValue = "Address", SText = register.address });
bodyMappings.Add(new Mapping() { SValue = "EMAIL_ID", SText = register.email });
bodyMappings.Add(new Mapping() { SValue = "RegisteredDate", SText = "" });
// SendNotificationRequest request = new SendNotificationRequest()
// {
// IsBulkNotification = false,
// UserName = register.email,
// ProviderId = "BasicRegistration",
// NotificationTypeId = NOTIFICATION_TYPE.EMAIL.ToString(),
// Template = Common.Models.Notification.NotifyTemplate.BASIC_REGISTRATION_EMAIL,
// Recipients = new List<RecipientViewModel>()
// {
// new RecipientViewModel()
// {
// NotificationContent = new NotificationDTO() {
// Body = JsonConvert.SerializeObject(bodyMappings),
// //Title will be set by mapping json
// },
// Address= register.email
// }
// }
// };
// var model = NotifierV2.SendNotification(request, NOTIFICATION_TYPE.EMAIL);
// }
// return model1;
//}
//catch (Exception ex)
//{
// _logger.LogError("Something Went Wrong, Please Try Again!!", ex);
// model1.SetResponse("1", "Error occurred while calling RequestOTP.");
// return model1;
//}
SendNotificationRequest request = new SendNotificationRequest()
{
IsBulkNotification = false,
UserName = register.email,
ProviderId = "BasicRegistration",
NotificationTypeId = NOTIFICATION_TYPE.EMAIL.ToString(),
Template = Common.Models.Notification.NotifyTemplate.BASIC_REGISTRATION_EMAIL,
Recipients = new List<RecipientViewModel>()
{
new RecipientViewModel()
{
NotificationContent = new NotificationDTO() {
Body = JsonConvert.SerializeObject(bodyMappings),
//Title will be set by mapping json
},
Address= register.email
}
}
};
var model = NotifierV2.SendNotification(request, NOTIFICATION_TYPE.EMAIL);
}
return model1;
}
catch (Exception ex)
{
_logger.LogError("Something Went Wrong, Please Try Again!!", ex);
model1.SetResponse("1", "Error occurred while calling RequestOTP.");
return model1;
}
}
public Task<AddressListResponse> GetAddressList(AddressRequest addressRequest)

12
CustomerOnlineV2/CustomerOnlineV2/Controllers/AccountController.cs

@ -271,18 +271,6 @@ namespace CustomerOnlineV2.Controllers
if (response.ErrorCode == ResponseHelper.SUCCESS.ToString())
{
var currentUser = HttpContext.User as ClaimsPrincipal;
var identity = currentUser?.Identity as ClaimsIdentity;
if (identity != null)
{
var isEmailVerifiedClaim = identity.FindFirst("IsEmailVerified");
if (isEmailVerifiedClaim != null)
{
identity.RemoveClaim(isEmailVerifiedClaim);
}
identity.AddClaim(new Claim("IsEmailVerified", "true"));
}
Log.Debug("ACCOUNTCONTROLLER | VERIFYOTP | REQUEST ARRIVED | " + loginDetails.Email);
return RedirectToAction("Index", "Home");
}

Loading…
Cancel
Save