From b8fa6d4c32b1d95ef5de04d6205a6710deb86ab6 Mon Sep 17 00:00:00 2001 From: Dinesh Date: Fri, 6 Oct 2023 02:03:21 +0545 Subject: [PATCH] Change password --- .../DocumentBusiness/DocumentBusiness.cs | 32 +++ .../DocumentBusiness/IDocumentBusiness.cs | 9 + .../DocumentModel/CustomerDocumentModel.cs | 23 ++ .../DocumentRepository/DocumentRepository.cs | 106 ++++++++ .../DocumentRepository/IDocumentRepository.cs | 10 + .../Controllers/CustomerDocumentController.cs | 67 +++++ CustomerOnlineV2/CustomerOnlineV2/Program.cs | 5 +- .../Views/Account/ForceChangePassword.cshtml | 4 +- .../Views/Account/ResetPassword.cshtml | 93 ++++++- .../CustomerDocument/CustomerDocument.cshtml | 250 ++++++++++++++++++ .../Views/Shared/_Layout.cshtml | 2 +- 11 files changed, 587 insertions(+), 14 deletions(-) create mode 100644 CustomerOnlineV2/CustomerOnlineV2.Business/Business/DocumentBusiness/DocumentBusiness.cs create mode 100644 CustomerOnlineV2/CustomerOnlineV2.Business/Business/DocumentBusiness/IDocumentBusiness.cs create mode 100644 CustomerOnlineV2/CustomerOnlineV2.Common/Models/DocumentModel/CustomerDocumentModel.cs create mode 100644 CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/DocumentRepository/DocumentRepository.cs create mode 100644 CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/DocumentRepository/IDocumentRepository.cs create mode 100644 CustomerOnlineV2/CustomerOnlineV2/Controllers/CustomerDocumentController.cs create mode 100644 CustomerOnlineV2/CustomerOnlineV2/Views/CustomerDocument/CustomerDocument.cshtml diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/Business/DocumentBusiness/DocumentBusiness.cs b/CustomerOnlineV2/CustomerOnlineV2.Business/Business/DocumentBusiness/DocumentBusiness.cs new file mode 100644 index 0000000..bb27e1c --- /dev/null +++ b/CustomerOnlineV2/CustomerOnlineV2.Business/Business/DocumentBusiness/DocumentBusiness.cs @@ -0,0 +1,32 @@ +using CustomerOnlineV2.Common.Models.DocumentModel; +using CustomerOnlineV2.Repository.Repository.DocumentRepository; +using CustomerOnlineV2.Repository.Repository.ReceiverRepository; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace CustomerOnlineV2.Business.Business.DocumentBusiness +{ + public class DocumentBusiness : IDocumentBusiness + { + + + private readonly IDocumentRepository _docRepository; + + + public DocumentBusiness(IDocumentRepository docRepository) + { + + _docRepository = docRepository; + + } + public async Task Document(CustomerDocumentModel doc, string? Id, string? user) + { + var model1 = await _docRepository.GetDocument(doc, Id, user); + return model1; + } + } +} diff --git a/CustomerOnlineV2/CustomerOnlineV2.Business/Business/DocumentBusiness/IDocumentBusiness.cs b/CustomerOnlineV2/CustomerOnlineV2.Business/Business/DocumentBusiness/IDocumentBusiness.cs new file mode 100644 index 0000000..72b7799 --- /dev/null +++ b/CustomerOnlineV2/CustomerOnlineV2.Business/Business/DocumentBusiness/IDocumentBusiness.cs @@ -0,0 +1,9 @@ +using CustomerOnlineV2.Common.Models.DocumentModel; + +namespace CustomerOnlineV2.Business.Business.DocumentBusiness +{ + public interface IDocumentBusiness + { + Task Document(CustomerDocumentModel doc, string userId, string userName); + } +} \ No newline at end of file diff --git a/CustomerOnlineV2/CustomerOnlineV2.Common/Models/DocumentModel/CustomerDocumentModel.cs b/CustomerOnlineV2/CustomerOnlineV2.Common/Models/DocumentModel/CustomerDocumentModel.cs new file mode 100644 index 0000000..3362410 --- /dev/null +++ b/CustomerOnlineV2/CustomerOnlineV2.Common/Models/DocumentModel/CustomerDocumentModel.cs @@ -0,0 +1,23 @@ +using Microsoft.AspNetCore.Http; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CustomerOnlineV2.Common.Models.DocumentModel +{ + public class CustomerDocumentModel: CommonResponse + { + public string? cdid { get; set; } + public string? customerId { get; set; } + public string? fileName { get; set;} + public string? description { get; set; } + public string? fileType { get; set; } + public string? documentType { get; set; } + public string? user { get; set;} + public string? sessionId { get; set; } + public IFormFile File { get; set; } + + } +} diff --git a/CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/DocumentRepository/DocumentRepository.cs b/CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/DocumentRepository/DocumentRepository.cs new file mode 100644 index 0000000..88cecc9 --- /dev/null +++ b/CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/DocumentRepository/DocumentRepository.cs @@ -0,0 +1,106 @@ +using CustomerOnlineV2.Common.Models; +using CustomerOnlineV2.Common.Models.DocumentModel; +using CustomerOnlineV2.Repository.ConnectionHelper; +using CustomerOnlineV2.Repository.Repository.RegisterRepository; +using Microsoft.VisualBasic.FileIO; +using NPoco; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace CustomerOnlineV2.Repository.Repository.DocumentRepository +{ + + + public class DocumentRepository : IDocumentRepository + { + + private readonly IConnectionHelper _connHelper; + + public DocumentRepository(IConnectionHelper connHelper) + { + _connHelper = connHelper; + } + //public void ExecuteStoredProcedure(string fileName) + //{ + // // try + // // { + // // string sql = "exec proc_customerDocumentType"; + // // if (cdId != "") + // // { + // // sql += " @flag ='u'"; + // // } + // // else + // // { + // // sql += " @flag ='i'"; + // // } + // // sql += ",@customerId =" + FilterString(customerId); + // // sql += ",@cdId =" + FilterString(cdId); + // // sql += ",@fileName =" + FilterString(fileName); + // // sql += ",@fileDescription =" + FilterString(fileDescription); + // // sql += ",@fileType =" + FilterString(fileType); + // // sql += ",@documentType =" + FilterString(documentType); + // // sql += ",@user =" + FilterString(user); + // // sql += ",@rowIdField =" + FilterString(sessionId); + // // } + // //catch (Exception ex) + // // { + // // ex.Message(w) + // // } + //} + + public async Task GetDocument(CustomerDocumentModel doc, string id, string user) + { + try + { + var sql = "exec proc_customerDocumentType"; + sql += " @flag = " + _connHelper.FilterString("i"); + sql += ",@customerId =" + _connHelper.FilterString(id); + sql += ",@user = " + _connHelper.FilterString(user); + sql += ",@cdId =" + _connHelper.FilterString(doc.cdid); + sql += ",@fileName =" + _connHelper.FilterString(doc.fileName); + sql += ",@fileDescription =" + _connHelper.FilterString(doc.description); + sql += ",@fileType =" + _connHelper.FilterString(doc.fileType); + sql += ",@documentType =" + _connHelper.FilterString(doc.documentType); + sql += ",@rowIdField =" + _connHelper.FilterString(doc.sessionId); + + var dt = _connHelper.ExecuteDataTable(sql); + if (dt == null || dt.Rows.Count <= 0) + { + doc.ResponseCode = ResponseHelper.FAILED; + doc.ResponseMessage = "DB Null Error!"; + + // _logger.LogError("RECEIVERREPOSITORY | GETRECEIVEDRDETAILS | DB RESPONSE | " + JsonConvert.SerializeObject(_response)); + } + else + { + doc.ResponseCode = ResponseHelper.SUCCESS; + doc.ResponseMessage = ResponseMessageHelper.SUCCESS; + + // _response.firstName = Convert.ToString(dt.Rows[0]["firstName"]); + // _response.middleName = Convert.ToString(dt.Rows[0]["middleName"]); + // _response.lastName1 = Convert.ToString(dt.Rows[0]["lastName1"]); + // _response.Country = Convert.ToString(dt.Rows[0]["Country"]); + // _response.Address = Convert.ToString(dt.Rows[0]["Address"]); + // _response.State = Convert.ToString(dt.Rows[0]["State"]); + } + } + catch (Exception ex) + { + doc.ResponseCode = ResponseHelper.EXCEPTION; + doc.ResponseMessage = "Exception occured: " + ex.Message; + + //_logger.LogError("RECEIVERREPOSITORY | GETRECEIVEDRDETAILS | EXCEPTION | " + JsonConvert.SerializeObject(_response)); + } + + return await Task.FromResult(doc); + + + } + } + +} diff --git a/CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/DocumentRepository/IDocumentRepository.cs b/CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/DocumentRepository/IDocumentRepository.cs new file mode 100644 index 0000000..b5635f6 --- /dev/null +++ b/CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/DocumentRepository/IDocumentRepository.cs @@ -0,0 +1,10 @@ +using CustomerOnlineV2.Common.Models.DocumentModel; + +namespace CustomerOnlineV2.Repository.Repository.DocumentRepository +{ + public interface IDocumentRepository + { + //void ExecuteStoredProcedure(string fileName); + Task GetDocument(CustomerDocumentModel doc, string? id, string? user); + } +} \ No newline at end of file diff --git a/CustomerOnlineV2/CustomerOnlineV2/Controllers/CustomerDocumentController.cs b/CustomerOnlineV2/CustomerOnlineV2/Controllers/CustomerDocumentController.cs new file mode 100644 index 0000000..6cf630c --- /dev/null +++ b/CustomerOnlineV2/CustomerOnlineV2/Controllers/CustomerDocumentController.cs @@ -0,0 +1,67 @@ +using CustomerOnlineV2.Common.Models.DocumentModel; +using CustomerOnlineV2.Common.Models.ReceiverModel; +using CustomerOnlineV2.Repository.Repository.DocumentRepository; +using Microsoft.AspNetCore.Mvc; +using Microsoft.IdentityModel.Protocols; +using NuGet.Protocol.Core.Types; +using NuGet.Protocol.Plugins; +using CustomerOnlineV2.Common.Helper; +using HttpPostAttribute = Microsoft.AspNetCore.Mvc.HttpPostAttribute; +using CustomerOnlineV2.Business.Business.DocumentBusiness; + +namespace CustomerOnlineV2.Controllers +{ + public class CustomerDocumentController : Controller + { + private readonly IDocumentBusiness _business; + + public CustomerDocumentController(IDocumentBusiness business) + { + _business = business; + } + + public IActionResult CustomerDocument() + { + return View(); + } + + [HttpPost] + + public async Task AddDocment(CustomerDocumentModel doc, string id, string user) + { + var loginDetails = HttpContext.GetLoginDetails(); + //ReceiverInformationModel _response = new ReceiverInformationModel(); + var Document = await _business.Document(doc, loginDetails.UserId, loginDetails.UserName); + return Document; + } + //public async Task Upload(CustomerDocumentModel model) + //{ + + + // var loginDetails = HttpContext.GetLoginDetails(); + // //ReceiverInformationModel _response = new ReceiverInformationModel(); + // var receiver1 = await _receiverBusiness.Receivers(receiver, loginDetails.UserId, loginDetails.UserName); + // return receiver1; + + // //////ar result = dbresult.Extra.Split('|'); + // //var customerId = result[0]; + // //var membershipId = result[1]; + // //var registerDate = result[2]; + + // //var loginDetails = HttpContext.GetLoginDetails(); + // //if (model.File != null && model.File.Length > 0) + // //{ + + // // var fileName = model.File.FileName; + // // var documentType = model.File.ContentType; + + // // ///var + // // _repository.ExecuteStoredProcedure(fileName); + + // // return Json(new { success = true, message = "File uploaded and processed successfully." }); + // //} + + // //return Json(new { success = false, message = "File upload failed." }); + //} + } +} diff --git a/CustomerOnlineV2/CustomerOnlineV2/Program.cs b/CustomerOnlineV2/CustomerOnlineV2/Program.cs index 1769ed5..c25652b 100644 --- a/CustomerOnlineV2/CustomerOnlineV2/Program.cs +++ b/CustomerOnlineV2/CustomerOnlineV2/Program.cs @@ -1,11 +1,13 @@ using CustomerOnlineV2.Api.API.TPApi; using CustomerOnlineV2.Business.Business.AccountBusiness; +using CustomerOnlineV2.Business.Business.DocumentBusiness; using CustomerOnlineV2.Business.Business.HomeBusiness; using CustomerOnlineV2.Business.Business.ReceiverBusiness; using CustomerOnlineV2.Business.Business.RegisterBusiness; using CustomerOnlineV2.Business.Business.TransactionBusiness; using CustomerOnlineV2.Repository.ConnectionHelper; using CustomerOnlineV2.Repository.Repository.AccountRepository; +using CustomerOnlineV2.Repository.Repository.DocumentRepository; using CustomerOnlineV2.Repository.Repository.HomeRepository; using CustomerOnlineV2.Repository.Repository.ReceiverRepository; using CustomerOnlineV2.Repository.Repository.RegisterRepository; @@ -53,7 +55,8 @@ builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); - +builder.Services.AddScoped(); +builder.Services.AddScoped(); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); diff --git a/CustomerOnlineV2/CustomerOnlineV2/Views/Account/ForceChangePassword.cshtml b/CustomerOnlineV2/CustomerOnlineV2/Views/Account/ForceChangePassword.cshtml index f260aa9..52dbb9b 100644 --- a/CustomerOnlineV2/CustomerOnlineV2/Views/Account/ForceChangePassword.cshtml +++ b/CustomerOnlineV2/CustomerOnlineV2/Views/Account/ForceChangePassword.cshtml @@ -86,11 +86,11 @@
- +
- +
diff --git a/CustomerOnlineV2/CustomerOnlineV2/Views/Account/ResetPassword.cshtml b/CustomerOnlineV2/CustomerOnlineV2/Views/Account/ResetPassword.cshtml index e891b75..7e657fe 100644 --- a/CustomerOnlineV2/CustomerOnlineV2/Views/Account/ResetPassword.cshtml +++ b/CustomerOnlineV2/CustomerOnlineV2/Views/Account/ResetPassword.cshtml @@ -1,12 +1,66 @@ @model CustomerOnlineV2.Common.Models.AccountModel.PasswordResetModel @{ - Layout = "_Layout2"; + Layout = null; } - + + + + + + + + + + + + +
+ + + + + @@ -20,8 +74,8 @@
Reset passowrd is simple, your can reset your password right away

- - @* *@
+ @* *@ +
@@ -30,14 +84,14 @@
@* *@ - +
-
Dont have username ? Registration won't take more than 5 min, Register Now
+
Dont have username ? Registration won't take more than 5 min, Register Now
Already registered, Login Now
@@ -72,6 +126,25 @@
+
+
+
+
+
+
+

+ IME London is a product of Subhida UK Limited, Pentax House,South Hill Avenue, South Harrow, London, H2A 0D + + Company Registration No. 06432399 Subhida UK Ltd is authorized and regulated by the Financial Conduct + Authority (FCA)
under the Payment Service Regulations 2017. FCA Registration No. 576127 HMRC Registration No. XYML000000119350 +

+
+
+
+

© IME London, 2023

+
+
+
+ } \ No newline at end of file diff --git a/CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout.cshtml b/CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout.cshtml index 8a250f0..59973e1 100644 --- a/CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout.cshtml +++ b/CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout.cshtml @@ -154,7 +154,7 @@