|
@ -1,6 +1,7 @@ |
|
|
using CustomerOnlineV2.Common.Models; |
|
|
using CustomerOnlineV2.Common.Models; |
|
|
using CustomerOnlineV2.Common.Models.AccountModel; |
|
|
using CustomerOnlineV2.Common.Models.AccountModel; |
|
|
using CustomerOnlineV2.Common.Models.HomeModel; |
|
|
using CustomerOnlineV2.Common.Models.HomeModel; |
|
|
|
|
|
using CustomerOnlineV2.Common.Models.ReceiverModel; |
|
|
using CustomerOnlineV2.Common.Models.RegisterModel; |
|
|
using CustomerOnlineV2.Common.Models.RegisterModel; |
|
|
using CustomerOnlineV2.Repository.ConnectionHelper; |
|
|
using CustomerOnlineV2.Repository.ConnectionHelper; |
|
|
using Microsoft.Extensions.Logging; |
|
|
using Microsoft.Extensions.Logging; |
|
@ -527,5 +528,51 @@ namespace CustomerOnlineV2.Repository.Repository.RegisterRepository |
|
|
|
|
|
|
|
|
return await Task.FromResult(_response); |
|
|
return await Task.FromResult(_response); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task<CustomerEditModel> CustomerIdInformationById(LoginResponse loginDetails) |
|
|
|
|
|
{ |
|
|
|
|
|
CustomerEditModel _response = new CustomerEditModel(); |
|
|
|
|
|
try |
|
|
|
|
|
{ |
|
|
|
|
|
var sql = "EXEC PROC_DYNAMIC_TABLE"; |
|
|
|
|
|
sql += " @Flag = " + _connHelper.FilterString("editCustomerId-byId"); |
|
|
|
|
|
sql += ",@id = " + _connHelper.FilterString(loginDetails.UserId); |
|
|
|
|
|
_logger.LogDebug("REGISTERREPOSITORY | EDITCUSTOMER | 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("REGISTERREPOSITORY | EDITCUSTOMER | DB RESPONSE | " + JsonConvert.SerializeObject(_response)); |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
_response.ResponseCode = Convert.ToInt16(dt.Rows[0]["errorCode"]); |
|
|
|
|
|
_response.ResponseMessage = Convert.ToString(dt.Rows[0]["msg"]); |
|
|
|
|
|
List<OnlineCustomerRegisterModel> obj = new List<OnlineCustomerRegisterModel>(); |
|
|
|
|
|
foreach (DataRow item in dt.Rows) |
|
|
|
|
|
{ |
|
|
|
|
|
obj.Add(new OnlineCustomerRegisterModel |
|
|
|
|
|
{ |
|
|
|
|
|
customerId = Convert.ToString(item["Id"]), |
|
|
|
|
|
idType = Convert.ToString(item["idType"]), |
|
|
|
|
|
idNumber = Convert.ToString(item["idNumber"]), |
|
|
|
|
|
idIssueDate = Convert.ToString(item["idIssueDate"]), |
|
|
|
|
|
idExpiryDate = Convert.ToString(item["idExpiryDate"]), |
|
|
|
|
|
nativeCountry = Convert.ToString(item["idIssueCountry"]), |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
_response.CustomerRegisterModel = obj; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
{ |
|
|
|
|
|
_response.ResponseCode = ResponseHelper.EXCEPTION; |
|
|
|
|
|
_response.ResponseMessage = "Exception occured: " + ex.Message; |
|
|
|
|
|
_logger.LogError("REGISTERREPOSITORY | EDITCUSTOMER | EXCEPTION | " + JsonConvert.SerializeObject(_response)); |
|
|
|
|
|
} |
|
|
|
|
|
return await Task.FromResult(_response); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |