Dinesh
12 months ago
11 changed files with 587 additions and 14 deletions
-
32CustomerOnlineV2/CustomerOnlineV2.Business/Business/DocumentBusiness/DocumentBusiness.cs
-
9CustomerOnlineV2/CustomerOnlineV2.Business/Business/DocumentBusiness/IDocumentBusiness.cs
-
23CustomerOnlineV2/CustomerOnlineV2.Common/Models/DocumentModel/CustomerDocumentModel.cs
-
106CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/DocumentRepository/DocumentRepository.cs
-
10CustomerOnlineV2/CustomerOnlineV2.Repository/Repository/DocumentRepository/IDocumentRepository.cs
-
67CustomerOnlineV2/CustomerOnlineV2/Controllers/CustomerDocumentController.cs
-
5CustomerOnlineV2/CustomerOnlineV2/Program.cs
-
4CustomerOnlineV2/CustomerOnlineV2/Views/Account/ForceChangePassword.cshtml
-
91CustomerOnlineV2/CustomerOnlineV2/Views/Account/ResetPassword.cshtml
-
250CustomerOnlineV2/CustomerOnlineV2/Views/CustomerDocument/CustomerDocument.cshtml
-
2CustomerOnlineV2/CustomerOnlineV2/Views/Shared/_Layout.cshtml
@ -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<CustomerDocumentModel> Document(CustomerDocumentModel doc, string? Id, string? user) |
||||
|
{ |
||||
|
var model1 = await _docRepository.GetDocument(doc, Id, user); |
||||
|
return model1; |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
using CustomerOnlineV2.Common.Models.DocumentModel; |
||||
|
|
||||
|
namespace CustomerOnlineV2.Business.Business.DocumentBusiness |
||||
|
{ |
||||
|
public interface IDocumentBusiness |
||||
|
{ |
||||
|
Task<CustomerDocumentModel> Document(CustomerDocumentModel doc, string userId, string userName); |
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
|
||||
|
} |
||||
|
} |
@ -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<CustomerDocumentModel> 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); |
||||
|
|
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
using CustomerOnlineV2.Common.Models.DocumentModel; |
||||
|
|
||||
|
namespace CustomerOnlineV2.Repository.Repository.DocumentRepository |
||||
|
{ |
||||
|
public interface IDocumentRepository |
||||
|
{ |
||||
|
//void ExecuteStoredProcedure(string fileName);
|
||||
|
Task<CustomerDocumentModel> GetDocument(CustomerDocumentModel doc, string? id, string? user); |
||||
|
} |
||||
|
} |
@ -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<CustomerDocumentModel> 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 <IActionResult> 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." });
|
||||
|
//}
|
||||
|
} |
||||
|
} |
@ -0,0 +1,250 @@ |
|||||
|
@model CustomerOnlineV2.Common.Models.DocumentModel.CustomerDocumentModel |
||||
|
@using CustomerOnlineV2.Common.Helper |
||||
|
@{ |
||||
|
Layout = "_Layout2"; |
||||
|
} |
||||
|
|
||||
|
@{ |
||||
|
var userInfo = Context.GetLoginDetails(); |
||||
|
|
||||
|
var fullName = userInfo.FullName; |
||||
|
var username = userInfo.UserName; |
||||
|
var firstName = fullName.Split(' ')[0]; |
||||
|
var mobileNumber = userInfo.MobileNumber; |
||||
|
var email = userInfo.Email; |
||||
|
var userId = userInfo.UserId; |
||||
|
|
||||
|
var errorMessage = Context.Request.Cookies["ErrorMessage"]; |
||||
|
var errorCode = Context.Request.Cookies["ErrorCode"]; |
||||
|
|
||||
|
CustomerOnlineV2.Helper.HelperClass.RemoveCookies("ErrorMessage", Context); |
||||
|
CustomerOnlineV2.Helper.HelperClass.RemoveCookies("ErrorCode", Context); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
<!-- Content --> |
||||
|
<div id="content" class="bg-light py-4"> |
||||
|
<div class="container"> |
||||
|
<div class="row"> |
||||
|
<!-- Left Panel --> |
||||
|
<aside class="col-lg-3"> |
||||
|
<!-- 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=""> |
||||
|
<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"> |
||||
|
</div> |
||||
|
</div> |
||||
|
<p class="text-3 fw-500 mb-2">Hello, @firstName</p> |
||||
|
<p class="text-3 fw-500 mb-2">User Id : <span>@userId</span></p> |
||||
|
|
||||
|
<p class="mb-2"> |
||||
|
<a href="profile.html" class="text-5 text-light" data-bs-toggle="tooltip" title="Edit Profile"> |
||||
|
<i class="fas fa-edit"></i> |
||||
|
</a> |
||||
|
</p> |
||||
|
|
||||
|
<div class="d-grid"> |
||||
|
<a href="document-upload.html" class="btn btn-primary">Upload documents</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- Profile Details End --> |
||||
|
<!-- Need Help? --> |
||||
|
<div class="bg-white rounded text-center p-3 mb-4"> |
||||
|
<div class="text-17 text-light my-3"><i class="fa fa-bullhorn"></i></div> |
||||
|
<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="btn btn-primary">Refer a Friend</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- Need Help? End --> |
||||
|
</aside> |
||||
|
<!-- Left Panel End --> |
||||
|
<!-- Middle Panel --> |
||||
|
<div class="col-lg-9"> |
||||
|
<div class="bg-white shadow-sm rounded p-4 mb-4"> |
||||
|
<h3 class="text-5 fw-400 mb-4">Valid ID Card<span class="text-muted text-2 ms-2">(BRP Card / Passport / Driving License)</span></h3> |
||||
|
<hr class="mb-4 mx-n4" /> |
||||
|
|
||||
|
<div class="row g-3"> |
||||
|
<div class="col-12 col-md-6 col-lg-4"> |
||||
|
<div class="account-doc rounded p-3"> |
||||
|
<div class="front"> |
||||
|
<img src="images/profile-thumb.jpg" class="img-fluid"> |
||||
|
<span class="mt-2">Front</span> |
||||
|
</div> |
||||
|
<div class="account-doc-overlay rounded"> |
||||
|
<a href="#" data-bs-target="#edit-doc-details" data-bs-toggle="modal" class="text-light btn-link mx-2"> |
||||
|
<span class="me-1"><i class="fas fa-edit"></i></span>Edit |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-12 col-md-6 col-lg-4"> |
||||
|
<div class="account-doc rounded p-3"> |
||||
|
<div class="front"> |
||||
|
<img src="images/profile-thumb.jpg" class="img-fluid"> |
||||
|
<span class="mt-2">Back</span> |
||||
|
</div> |
||||
|
<div class="account-doc-overlay rounded"> |
||||
|
<a href="#" data-bs-target="#edit-doc-details" data-bs-toggle="modal" class="text-light btn-link mx-2"> |
||||
|
<span class="me-1"><i class="fas fa-edit"></i></span>Edit |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-12 col-md-6 col-lg-4"> |
||||
|
<a href="" data-bs-target="#edit-doc-details" data-bs-toggle="modal" class="account-doc-new d-flex align-items-center rounded h-100 p-3 mb-4 mb-lg-0"> |
||||
|
<p class="w-100 text-center lh-base m-0"> |
||||
|
<span class="text-3"><i class="fas fa-plus-circle"></i></span> <span class="d-block text-body text-3">Add New Document</span> |
||||
|
</p> |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<div class="bg-white shadow-sm rounded p-4 mb-4"> |
||||
|
<h3 class="text-5 fw-400 mb-4">Proof of address<span class="text-muted text-2 ms-2">(Bank Statement / Utility Bills / Driving License)</span></h3> |
||||
|
<hr class="mb-4 mx-n4" /> |
||||
|
|
||||
|
<div class="row g-3"> |
||||
|
<div class="col-12 col-md-6 col-lg-4"> |
||||
|
<div class="account-doc rounded p-3"> |
||||
|
<div class="front"> |
||||
|
<img src="images/profile-thumb.jpg" class="img-fluid"> |
||||
|
<span class="mt-2">Front</span> |
||||
|
</div> |
||||
|
<div class="account-doc-overlay rounded"> |
||||
|
<a href="#" data-bs-target="#edit-doc-details" data-bs-toggle="modal" class="text-light btn-link mx-2"> |
||||
|
<span class="me-1"><i class="fas fa-edit"></i></span>Edit |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-12 col-md-6 col-lg-4"> |
||||
|
<div class="account-doc rounded p-3"> |
||||
|
<div class="front"> |
||||
|
<img src="images/profile-thumb.jpg" class="img-fluid"> |
||||
|
<span class="mt-2">Back</span> |
||||
|
</div> |
||||
|
<div class="account-doc-overlay rounded"> |
||||
|
<a href="#" data-bs-target="#edit-doc-details" data-bs-toggle="modal" class="text-light btn-link mx-2"> |
||||
|
<span class="me-1"><i class="fas fa-edit"></i></span>Edit |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="col-12 col-md-6 col-lg-4"> |
||||
|
<a href="" data-bs-target="#edit-doc-details" data-bs-toggle="modal" class="account-doc-new d-flex align-items-center rounded h-100 p-3 mb-4 mb-lg-0"> |
||||
|
<p class="w-100 text-center lh-base m-0"> |
||||
|
<span class="text-3"><i class="fas fa-plus-circle"></i></span> <span class="d-block text-body text-3">Add New Document</span> |
||||
|
</p> |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
|
||||
|
</div> |
||||
|
|
||||
|
|
||||
|
<!-- Edit Card Details Modal --> |
||||
|
<div id="edit-doc-details" 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">Update Document</h5> |
||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> |
||||
|
</div> |
||||
|
<div class="modal-body p-4"> |
||||
|
<form id="updateCard" method="post"> |
||||
|
<div class="mb-3"> |
||||
|
<label for="IdFront" class="form-label">Document Type</label> |
||||
|
<select class="form-select" asp-for="documentType" aria-label="Floating label select example" asp-items="@CustomerOnlineV2.Helper.HelperClass.GetDropdownData("getIdType", true)" required> |
||||
|
@* <select class="form-select" id="doc" name=""> *@ |
||||
|
@* <option value="0" selected>-- Select --</option> |
||||
|
<option value="1">Id Card</option> |
||||
|
<option value="2">Passport </option> |
||||
|
<option value="3">License</option> *@ |
||||
|
</select> |
||||
|
</div> |
||||
|
<div class="mb-3"> |
||||
|
<label for="IdFront" class="form-label">Document Front</label> |
||||
|
<div class="input-group flex-nowrap"> |
||||
|
<div class="flex-grow-1 input-file"> |
||||
|
<input type="text" asp-for="fileName" class="form-control" placeholder="Chose File..." /> |
||||
|
</div> |
||||
|
<span class="input-group-text px-2"> |
||||
|
<button class="btn-choose bg-transparent text-white border-0" type="button">Upload</button> |
||||
|
</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="mb-3"> |
||||
|
<label for="IdBack" class="form-label">Document Back</label> |
||||
|
<div class="input-group flex-nowrap"> |
||||
|
<div class="flex-grow-1 input-file"> |
||||
|
<input type="text" id="IdBack" class="form-control" placeholder="Chose File..."> |
||||
|
</div> |
||||
|
<span class="input-group-text px-2"> |
||||
|
<button class="btn-choose bg-transparent text-white border-0" type="button">Upload</button> |
||||
|
</span> |
||||
|
</div> |
||||
|
</div> |
||||
|
|
||||
|
<div class="d-grid mt-4"><button class="btn btn-primary" onclick="btnUpload" type="submit">Update Document</button></div> |
||||
|
</form> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- Middle Panel End --> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- Content end --> |
||||
|
@section Scripts { |
||||
|
|
||||
|
<script> |
||||
|
$(document).ready(function () { |
||||
|
debugger; |
||||
|
$('#updateCard').submit(function (e) { |
||||
|
e.preventDefault(); |
||||
|
|
||||
|
var formData = new FormData(this); |
||||
|
|
||||
|
$.ajax({ |
||||
|
url: '/CustomerDocument/Upload', |
||||
|
type: 'POST', |
||||
|
data: formData, |
||||
|
processData: false, |
||||
|
contentType: false, |
||||
|
success: function (data) { |
||||
|
// Handle success |
||||
|
$('#result').text('File uploaded successfully.'); |
||||
|
}, |
||||
|
error: function (error) { |
||||
|
// Handle error |
||||
|
$('#result').text('File upload failed: ' + error.responseText); |
||||
|
} |
||||
|
}); |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
$(document).ready(function () { |
||||
|
debugger; |
||||
|
$('#submit').click(function () { |
||||
|
var url = $(location).attr('href'); |
||||
|
$('#btnUpload').html('<strong>' + url + '</strong>'); |
||||
|
}); |
||||
|
}); |
||||
|
</script> |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue