Browse Source

customer profile

feature/19315_Customer-Registration-new
Dinesh 12 months ago
parent
commit
229ed72a0c
  1. 7
      CustomerOnlineV2/CustomerOnlineV2.Business/Business/RegisterBusiness/IRegisterBusiness.cs
  2. 6
      CustomerOnlineV2/CustomerOnlineV2.Business/Business/RegisterBusiness/RegisterBusiness.cs
  3. 67
      CustomerOnlineV2/CustomerOnlineV2.Common/Models/RegisterModel/UserRegisterResponse.cs
  4. 2
      CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/AccountRepository/AccountRepository.cs
  5. 4
      CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/RegisterRepository/IRegisterRepository.cs
  6. 63
      CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/RegisterRepository/RegisterRepository.cs
  7. 14
      CustomerOnlineV2/CustomerOnlineV2/Controllers/CustomerController.cs
  8. 143
      CustomerOnlineV2/CustomerOnlineV2/Views/Customer/CustomerProfile.cshtml

7
CustomerOnlineV2/CustomerOnlineV2.Business/Business/RegisterBusiness/IRegisterBusiness.cs

@ -1,4 +1,6 @@
using CustomerOnlineV2.Common.Models;
using CustomerOnlineV2.Common.Models.AccountModel;
using CustomerOnlineV2.Common.Models.HomeModel;
using CustomerOnlineV2.Common.Models.RegisterModel;
using System;
using System.Collections.Generic;
@ -12,5 +14,10 @@ namespace CustomerOnlineV2.Business.Business.RegisterBusiness
{
Task<CommonResponse> AddCustomers(OnlineCustomerRegisterModel register);
Task<AddressListResponse> GetAddressList(AddressRequest addressRequest);
// Task<CustomerList> GetTranCustomerById(string id);
//Task<CustomerList> GetCustomerDetailById(LoginResponse loginDetails);
Task<CustomerList> GetTranCustomerById(LoginResponse loginDetails);
//Task<CustomerTransactionList> GetTranCustomerById(string id);
}
}

6
CustomerOnlineV2/CustomerOnlineV2.Business/Business/RegisterBusiness/RegisterBusiness.cs

@ -1,5 +1,6 @@
using CustomerOnlineV2.Api.API.TPApi;
using CustomerOnlineV2.Common.Models;
using CustomerOnlineV2.Common.Models.AccountModel;
using CustomerOnlineV2.Common.Models.RegisterModel;
using CustomerOnlineV2.Repository.Repository.RegisterRepository;
using Microsoft.Extensions.Logging;
@ -37,5 +38,10 @@ namespace CustomerOnlineV2.Business.Business.RegisterBusiness
{
throw new NotImplementedException();
}
public async Task<CustomerList> GetTranCustomerById(LoginResponse loginDetails)
{
return await _registerRepository.GetTranCustomerById(loginDetails);
}
}
}

67
CustomerOnlineV2/CustomerOnlineV2.Common/Models/RegisterModel/UserRegisterResponse.cs

@ -6,6 +6,7 @@ using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using CustomerOnlineV2.Common.Models.HomeModel;
namespace CustomerOnlineV2.Common.Models.RegisterModel
{
@ -32,6 +33,72 @@ namespace CustomerOnlineV2.Common.Models.RegisterModel
public string? Extra2 { get; set; }
public object? Data { get; set; }
}
public class CustomerList : CommonResponse
{
public List<CustomerListModel>? CustomerListModel { get; set; }
}
public class CustomerListModel
{
public string? flag { get; set; }
public string? customerId { get; set; }
//public string? password { get; set; }
public string? firstName { get; set; }
public string? middleName { get; set; }
public string? lastName1 { get; set; }
public string? lastName2 { get; set; }
public string? country { get; set; }
public string? address { get; set; }
public string? state { get; set; }
public string? zipCode { get; set; }
public string? district { get; set; }
public string? city { get; set; }
public string? email { get; set; }
public string? homePhone { get; set; }
public string? workPhone { get; set; }
public string? mobile { get; set; }
public string? nativeCountry { get; set; }
public string? dob { get; set; }
public string? placeOfIssue { get; set; }
public string? customerType { get; set; }
public string? occupation { get; set; }
public string? isBlackListed { get; set; }
public string? createdBy { get; set; }
public string? createdDate { get; set; }
public string? modifiedBy { get; set; }
public string? modifiedDate { get; set; }
public string? approvedBy { get; set; }
public string? approvedDate { get; set; }
public string? isDeleted { get; set; }
public string? lastTranId { get; set; }
public string? sourceOfFound { get; set; }
public string? relationId { get; set; }
public string? relativeName { get; set; }
public string? address2 { get; set; }
public string? fullName { get; set; }
public string? postalCode { get; set; }
public string? idExpiryDate { get; set; }
public string? idType { get; set; }
public string? idNumber { get; set; }
public string? otherIdNumber { get; set; }
public string? telNo { get; set; }
public string? companyName { get; set; }
public string? gender { get; set; }
public string? salaryRange { get; set; }
public string? bonusPointPending { get; set; }
public string? totalSent { get; set; }
public string? idIssueDate { get; set; }
public string? customerStatus { get; set; }
public string? isActive { get; set; }
public string? islocked { get; set; }
public string? sessionId { get; set; }
public string? AboutUs { get; set; }
}
public class OnlineCustomerRegisterModel : CommonResponse
{

2
CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/AccountRepository/AccountRepository.cs

@ -76,7 +76,7 @@ namespace CustomerOnlineV2.Repository.Repository.AccountRepository
var sql = "EXEC PROC_DYNAMIC_TABLE";
sql += " @Flag = " + _connHelper.FilterString("ForceChange");
sql += ",@UserEmail = " + _connHelper.FilterString(logindetails.UserName);
//sql += ",@OldPassword = " + _connHelper.FilterString(model.OldPassword);
sql += ",@OldPassword = " + _connHelper.FilterString(model.OldPassword);
sql += ",@Password = " + _connHelper.FilterString(model.NewPassword);
sql += ",@ConfirmPassword = " + _connHelper.FilterString(model.ConfirmNewPassword);
sql += ",@ipAddress = " + _connHelper.FilterString(model.IpAddress);

4
CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/RegisterRepository/IRegisterRepository.cs

@ -1,4 +1,5 @@
using CustomerOnlineV2.Common.Models;
using CustomerOnlineV2.Common.Models.AccountModel;
using CustomerOnlineV2.Common.Models.RegisterModel;
using System;
using System.Collections.Generic;
@ -11,5 +12,8 @@ namespace CustomerOnlineV2.Repository.Repository.RegisterRepository
public interface IRegisterRepository
{
Task<CommonResponse> AddRegisterDetails(OnlineCustomerRegisterModel register);
// Task<CustomerList> GetCustomerDetailById(string id);
//Task<CustomerList> GetCustomerDetailById(LoginResponse loginDetails);
Task<CustomerList> GetTranCustomerById(LoginResponse loginDetails);
}
}

63
CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/RegisterRepository/RegisterRepository.cs

@ -1,8 +1,12 @@
using CustomerOnlineV2.Common.Models;
using CustomerOnlineV2.Common.Models.AccountModel;
using CustomerOnlineV2.Common.Models.HomeModel;
using CustomerOnlineV2.Common.Models.RegisterModel;
using CustomerOnlineV2.Repository.ConnectionHelper;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Text;
@ -89,5 +93,64 @@ namespace CustomerOnlineV2.Repository.Repository.RegisterRepository
return await Task.FromResult(model);
}
public async Task<CustomerList> GetTranCustomerById(LoginResponse loginDetails)
{
CustomerList _response = new CustomerList();
try
{
var sql = "EXEC mobile_proc_online_customerMaster_V1";
sql += " @Flag = " + _connHelper.FilterString("detail");
sql += ",@customerId= " + _connHelper.FilterString(loginDetails.UserId);
//logger.LogDebug("HOMEREPOSITORY | GETTRANSACTIONDETAIL | 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 | GETTRANSACTIONDETAIL | DB RESPONSE | " + JsonConvert.SerializeObject(_response));
}
else
{
_response.ResponseCode = Convert.ToInt16(dt.Rows[0]["errorCode"]);
_response.ResponseMessage = Convert.ToString(dt.Rows[0]["msg"]);
List<CustomerListModel> obj = new List<CustomerListModel>();
foreach (DataRow item in dt.Rows)
{
obj.Add(new CustomerListModel
{
fullName = Convert.ToString(item["fullName"]),
email = Convert.ToString(item["email"]),
mobile = Convert.ToString(item["mobile"]),
dob = Convert.ToString(item["dob"]),
zipCode = Convert.ToString(item["zipCode"]),
city = Convert.ToString(item["city"]),
country = Convert.ToString(item["countryName"]),
address = Convert.ToString(item["address1"]),
address2 = Convert.ToString(item["address2"]),
idType = Convert.ToString(item["idType"]),
idNumber = Convert.ToString(item["idNumber"]),
idIssueDate = Convert.ToString(item["idIssueDate"]),
idExpiryDate = Convert.ToString(item["idExpiryDate"]),
nativeCountry = Convert.ToString(item["ICountryName"])
});
}
_response.CustomerListModel = obj;
}
}
catch (Exception ex)
{
_response.ResponseCode = ResponseHelper.EXCEPTION;
_response.ResponseMessage = "Exception occured: " + ex.Message;
//logger.LogError("HOMEREPOSITORY | GETTRANSACTIONDETAIL | EXCEPTION | " + JsonConvert.SerializeObject(_response));
}
return await Task.FromResult(_response);
}
}
}

14
CustomerOnlineV2/CustomerOnlineV2/Controllers/CustomerController.cs

@ -2,12 +2,13 @@
using CustomerOnlineV2.Authorization;
using CustomerOnlineV2.Business.Business.RegisterBusiness;
using CustomerOnlineV2.Common.Models;
using CustomerOnlineV2.Common.Models.ReceiverModel;
using CustomerOnlineV2.Common.Helper;
using HttpPostAttribute = Microsoft.AspNetCore.Mvc.HttpPostAttribute;
using Controller = Microsoft.AspNetCore.Mvc.Controller;
using CustomerOnlineV2.Common.Models.RegisterModel;
using CustomerOnlineV2.Common.Models.TransactionModel;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
using Serilog.Context;
namespace CustomerOnlineV2.Controllers
{
@ -83,5 +84,12 @@ namespace CustomerOnlineV2.Controllers
{
return View();
}
[HttpGet]
[Route("Customer/GetCustomerDetail")]
public async Task<CustomerList> GetCustomerDetail()
{
var loginDetails = HttpContext.GetLoginDetails();
return await _registerBusiness.GetTranCustomerById(loginDetails);
}
}
}

143
CustomerOnlineV2/CustomerOnlineV2/Views/Customer/CustomerProfile.cshtml

@ -41,7 +41,7 @@
<!-- Profile Details -->
<div class="bg-white rounded text-center p-3 mb-4">
<div class="profile-thumb mt-3 mb-4">
<img class="rounded-circle" src="images/profile-thumb.jpg" alt="">
@* <img class="rounded-circle" src="images/profile-thumb.jpg" alt=""> *@
<div class="profile-thumb-edit bg-primary text-white" data-bs-toggle="tooltip" title="Change Profile Picture">
<i class="fas fa-camera position-absolute"></i>
<input type="file" class="custom-file-input" id="customFile">
@ -81,24 +81,24 @@
</h3>
<hr class="mx-n4 mb-4" />
<div class="row gx-3 align-items-center">
<label class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">Name:</label>
<p class="col-sm-9 text-3">@fullName</p>
<p class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">Name:</p>
<p class="col-sm-9 text-3" id="fullName"></p>
</div>
<div class="row gx-3 align-items-center">
<label class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">Date of Birth:</label>
<p class="col-sm-9 text-3"></p>
<label class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3" id="">Date of Birth:</label>
<p class="col-sm-9 text-3" id="dob"></p>
</div>
<div class="row gx-3 align-items-baseline">
<label class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">Email Address:</label>
<p class="col-sm-9 text-3">
@email
<p class="col-sm-9 text-3" id="email">
</p>
</div>
<div class="row gx-3 align-items-baseline">
<label class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">Mobile :</label>
<p class="col-sm-9 text-3">
@mobileNumber
<p class="col-sm-9 text-3" id="mobile">
</p>
</div>
<div class="row gx-3 align-items-baseline">
@ -108,9 +108,9 @@
</p>
</div>
<div class="row gx-3 align-items-baseline">
<label class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">Account Status:</label>
<label class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3" s>Account Status:</label>
<p class="col-sm-9 text-3">
<span class="bg-success text-white rounded-pill d-inline-block px-2 mb-0"><i class="fas fa-check-circle"></i> Active</span>
<span class="bg-success text-white rounded-pill d-inline-block px-2 mb-0" id="Status"><i class="fas fa-check-circle"></i> Active</span>
</p>
</div>
</div>
@ -131,23 +131,23 @@
<hr class="mx-n4 mb-4" />
<div class="row gx-3 align-items-center">
<p class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">ZipCode:</p>
<p class="col-sm-9 text-3"></p>
<p class="col-sm-9 text-3" id="zipCode"></p>
</div>
<div class="row gx-3 align-items-center">
<P class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">City:</P>
<p class="col-sm-9 text-3"> </p>
<p class="col-sm-9 text-3" id="city"> </p>
</div>
<div class="row gx-3 align-items-center">
<p class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">Address1:</p>
<p class="col-sm-9 text-3">
ewewe
<p class="col-sm-9 text-3" id="address1">
</p>
</div>
<div class="row gx-3 align-items-center">
<p class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">Address2:</p>
<p class="col-sm-9 text-3">
gdgdgd
<p class="col-sm-9 text-3" id="address2">
</p>
</div>
</div>
@ -222,52 +222,7 @@
</div>
</div>
</div>
@* <!-- Edit Details Modal -->
<div id="edit-account-settings" class="modal fade" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title fw-400">Account Settings</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body p-4">
<form id="accountSettings" method="post">
<div class="row g-3">
<div class="col-12">
<label for="language" class="form-label">Language</label>
<select class="form-select" id="language" name="language_id">
<option value="1">English (United States)</option>
<option value="2">Spanish </option>
<option value="3">Chinese</option>
<option value="4">Russian</option>
</select>
</div>
<div class="col-12">
<label for="input-timezone" class="form-label">Time Zone</label>
<select class="form-select" id="input-timezone" name="timezone_id">
<option value="0">(GMT+00:00) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London</option>
<option value="5.75">(GMT+05:45) Kathmandu</option>
<option value="6">(GMT+06:00) Astana, Dhaka</option>
</select>
</div>
<div class="col-12">
<label for="accountStatus" class="form-label">Account Status</label>
<select class="form-select" id="accountStatus" name="language_id">
<option value="1">Active</option>
<option value="2">In Active</option>
</select>
</div>
<div class="col-12 d-grid mt-4">
<button class="btn btn-primary" type="submit">Save Changes</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Account Settings End -->
<!-- Email Addresses --> *@
<div class="bg-white shadow-sm rounded p-4 mb-4">
<h3 class="text-5 fw-400 d-flex align-items-center mb-4">
Account Setting
@ -278,27 +233,27 @@
<hr class="mx-n4 mb-4" />
<div class="row gx-3 align-items-center">
<p class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">Nationality:</p>
<p class="col-sm-9 text-3">Nepal</p>
<p class="col-sm-9 text-3" id="nationality"></p>
</div>
<div class="row gx-3 align-items-center">
<p class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">Id Type:</p>
<p class="col-sm-9 text-3">Citizenship</p>
<p class="col-sm-9 text-3" id="idtype"></p>
</div>
<div class="row gx-3 align-items-center">
<p class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">Id Number:</p>
<p class="col-sm-9 text-3">1236</p>
<p class="col-sm-9 text-3" id="idnumber"></p>
</div>
<div class="row gx-3 align-items-center">
<p class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">IdIssue Country :</p>
<p class="col-sm-9 text-3">1236</p>
<p class="col-sm-9 text-3" id="idIssuecountry"></p>
</div>
<div class="row gx-3 align-items-center">
<p class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">Id Issue Date:</p>
<p class="col-sm-9 text-3">1236</p>
<p class="col-sm-9 text-3" id="idissueDate"></p>
</div>
<div class="row gx-3 align-items-center">
<p class="col-sm-3 text-muted text-sm-end mb-0 mb-sm-3">Id Expiry Date:</p>
<p class="col-sm-9 text-3">1236</p>
<p class="col-sm-9 text-3 " id="expairydate"></p>
</div>
</div>
<!-- Edit Details Modal -->
@ -306,7 +261,7 @@
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title fw-400">Email Addresses</h5>
<h5 class="modal-title fw-400">Document</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body p-4">
@ -358,12 +313,19 @@
</div>
</div>
@section Scripts {
<script>
$(document).ready(function () {
getData();
});
// function pageLoad() {
// getData(id);
// }
$(document).ready(function () {
debugger;
$('#btnSearch').click(function (e) {
e.preventDefault();
var postalCode = $('#postalCode').val();
@ -426,11 +388,42 @@
});
});
});
});
function getData() {
debugger;
$.ajax({
//var id;
type: 'GET',
contentType: 'application/json; charset=utf-8',
url: '/Customer/GetCustomerDetail',
success: function (response) {
debugger;
var data = response.customerListModel[0];
$('#fullName').text(data.fullName);
$('#dob').text(data.dob);
$('#email').text(data.email);
$('#mobile').text(data.mobile);
$('#zipCode').text(data.zipCode);
$('#city').text(data.city);
$('#address1').text(data.address);
$('#address2').text(data.address2);
$('#nationality').text(data.country);
$('#idtype').text(data.idType);
$('#idnumber').text(data.idNumber);
$('#idIssuecountry').text(data.nativeCountry);
$('#idissueDate').text(data.idIssueDate);
$('#expairydate').text(data.idExpiryDate);
$('#expairydate').text(data.idExpiryDate);
},
error: function (error) {
console.error(error);
}
});
}

Loading…
Cancel
Save