Browse Source

add customer name in reward list

feature/Redmine-17825-Email_Template
shakun 8 months ago
parent
commit
7687ad80c9
  1. 38
      Business/Mobile/MobileServices.cs
  2. 2
      Business/SendMoney/SendMoneyBusiness.cs
  3. 7
      Common/Helper/GetStatic.cs
  4. 2
      Common/Model/ExRateCalculateRequest.cs
  5. 10
      JsonRx/Api/CustomerController.cs
  6. 14
      JsonRx/Api/MobileController.cs
  7. 12
      JsonRx/Api/SendMoneyController.cs
  8. 80
      Repository/Authentication/AuthenticationRepo.cs
  9. 42
      Repository/Mobile/MobileServicesRepo.cs

38
Business/Mobile/MobileServices.cs

@ -398,7 +398,7 @@ namespace Business.Mobile
CAmount = Convert.ToDecimal(m.cAmount == "" ? "0" : m.cAmount),
CardOnline = "",
CollCurrency = m.sCurrency,
CouponCode = "",
CouponCode = m.DeviceType,
CustomerId = 0,
IsExRateCalcByPartner = false,
IsManualSc = false,
@ -719,7 +719,7 @@ namespace Business.Mobile
if (!jsonRx.ErrorCode.Equals("0"))
{
Log.Debug("RegisterKYC | Validate form failed : " + JsonConvert.SerializeObject(jsonRx));
jsonRx.SetResponse("1", jsonRx.Msg);
jsonRx.SetResponse("100", jsonRx.Msg);
return jsonRx;
}
@ -1028,7 +1028,7 @@ namespace Business.Mobile
{
enumString = RESPONSE_MSG.VALIDATE_FORM_2.ToString();
var map = Utilities.GetLanguageMapping(enumString, lang);
jsonRx.SetResponse("1", map.Message);
jsonRx.SetResponse("100", map.Message);
return jsonRx;
}
@ -1038,7 +1038,7 @@ namespace Business.Mobile
{
enumString = RESPONSE_MSG.VALIDATE_FORM_9.ToString();
var map = Utilities.GetLanguageMapping(enumString, lang);
jsonRx.SetResponse("1", map.Message);
jsonRx.SetResponse("100", map.Message);
return jsonRx;
}
@ -1047,19 +1047,19 @@ namespace Business.Mobile
if (string.IsNullOrEmpty(kyc.idExpiryDate))
{
jsonRx.SetResponse("1", "IdExpiryDate is required");
jsonRx.SetResponse("100", "IdExpiryDate is required");
return jsonRx;
}
if (string.IsNullOrEmpty(kyc.idStartDate))
{
jsonRx.SetResponse("1", "Idissue Date is required");
jsonRx.SetResponse("100", "Idissue Date is required");
return jsonRx;
}
if (string.IsNullOrEmpty(kyc.idIssuingCountry))
{
jsonRx.SetResponse("1", "idIssuingCountry is required");
jsonRx.SetResponse("100", "idIssuingCountry is required");
return jsonRx;
}
}
@ -1117,7 +1117,7 @@ namespace Business.Mobile
{
enumString = RESPONSE_MSG.VALIDATE_FORM_1.ToString();
var map = Utilities.GetLanguageMapping(enumString, lang);
jsonRx.SetResponse("1", map.Message);
jsonRx.SetResponse("100", map.Message);
return jsonRx;
}
}
@ -1125,7 +1125,7 @@ namespace Business.Mobile
{
enumString = RESPONSE_MSG.VALIDATE_FORM_10.ToString();
var map = Utilities.GetLanguageMapping(enumString, lang);
jsonRx.SetResponse("1", map.Message);
jsonRx.SetResponse("100", map.Message);
return jsonRx;
}
@ -1133,14 +1133,14 @@ namespace Business.Mobile
{
if (isBackRequired == "1" && additionalIdBackUrl == null)
{
jsonRx.SetResponse("1", "Additional ID Back is required!");
jsonRx.SetResponse("100", "Additional ID Back is required!");
return jsonRx;
}
if (string.IsNullOrEmpty(kyc.additionalIdType))
{
enumString = RESPONSE_MSG.VALIDATE_FORM_8.ToString();
var map = Utilities.GetLanguageMapping(enumString, lang);
jsonRx.SetResponse("1", map.Message);
jsonRx.SetResponse("100", map.Message);
return jsonRx;
}
}
@ -1149,7 +1149,7 @@ namespace Business.Mobile
if (!IsValidImage(ref kyc, idFrontUrl, idBackUrl, idSideUrl, additionalIdUrl, facePictureUrl, additionalIdBackUrl))
{
Log.Debug("IsValidatedForm | Validate Image : Failed");
jsonRx.SetResponse("1", "Invalid image file.");
jsonRx.SetResponse("100", "Invalid image file.");
return jsonRx;
}
@ -1709,12 +1709,12 @@ namespace Business.Mobile
JsonRxResponse _resp = new JsonRxResponse() { ErrorCode = "0", Msg = "Success" };
if (string.IsNullOrEmpty(confirmpwd))
{
_resp.SetResponse("1", "Password can not be empty!");
_resp.SetResponse("100", "Password can not be empty!");
return _resp;
}
if (confirmpwd.Length < 6)
{
_resp.SetResponse("1", "Password must be of atleast 6 digits!");
_resp.SetResponse("100", "Password must be of atleast 6 digits!");
return _resp;
}
@ -1754,7 +1754,7 @@ namespace Business.Mobile
{
enumString = RESPONSE_MSG.NEW_USER_REGISTER_FAIL_4.ToString();
var map = Utilities.GetLanguageMapping(enumString, lang);
res.SetResponse("1", map.Message);
res.SetResponse("100", map.Message);
return res;
}
@ -1763,7 +1763,7 @@ namespace Business.Mobile
{
enumString = RESPONSE_MSG.NEW_USER_REGISTER_FAIL_6.ToString();
var map = Utilities.GetLanguageMapping(enumString, lang);
res.SetResponse("1", map.Message);
res.SetResponse("100", map.Message);
return res;
}
@ -1772,7 +1772,7 @@ namespace Business.Mobile
{
enumString = RESPONSE_MSG.NEW_USER_REGISTER_FAIL_5.ToString();
var map = Utilities.GetLanguageMapping(enumString, lang);
res.SetResponse("1", map.Message);
res.SetResponse("100", map.Message);
return res;
}
@ -2180,7 +2180,7 @@ namespace Business.Mobile
if (liWalletStmtResponse == null)
{
jsonRx.ErrorCode = "1";
jsonRx.Msg = "No wallet statement found.";
jsonRx.Msg = "No Record(s) Found!";
jsonRx.Data = new System.Collections.ArrayList();
Log.Debug("GetWalletStatement | Returning null while fetching the list of wallet statements.");
return jsonRx;
@ -2414,7 +2414,7 @@ namespace Business.Mobile
if (requiredList.Count > 0)
{
// string.Format("Required Fields:-" , string.Join(", ", requiredList.Select(x => x.Key).ToList()));
jsonResult.SetResponse("1", string.Format("Required Fields:-\r\n {0}", string.Join("\r\n", requiredList.Select(x => findMapKeyValue(x.Key)).ToList())));
jsonResult.SetResponse("100", string.Format("Required Fields:-\r\n{0}", string.Join("\r\n", requiredList.Select(x => findMapKeyValue(x.Key)).ToList())));
return jsonResult;
}

2
Business/SendMoney/SendMoneyBusiness.cs

@ -157,7 +157,7 @@ namespace Business.SendMoney
CAmount = Convert.ToDecimal(m.cAmount == "" ? "0" : m.cAmount),
CardOnline = "",
CollCurrency = m.sCurrency,
CouponCode = "",
CouponCode = m.DeviceType,
CustomerId = 0,
IsManualSc = false,
IsOnline = false,

7
Common/Helper/GetStatic.cs

@ -57,6 +57,13 @@ namespace Common.Helper
else
return strVal;
}
public static String ShowDecimal1(String strVal)
{
if (strVal != "")
return double.Parse(strVal).ToString("0.00");
else
return strVal;
}
public static String ShowCommaAmt(string strVal)
{

2
Common/Model/ExRateCalculateRequest.cs

@ -23,6 +23,8 @@ namespace Common.Model
public string tpPCurrnecy { get; set; }
public string userId { get; set; }
public string discountedFee { get; set; }
public string DeviceType { get; set; }
}
public class CommonRequest

10
JsonRx/Api/CustomerController.cs

@ -113,7 +113,7 @@ namespace JsonRx.Api
JsonRxResponse res = new JsonRxResponse();
if (string.IsNullOrEmpty(newUserRegister.UserId))
{
res.SetResponse("1", "Email is required!");
res.SetResponse("100", "Email is required!");
return Ok(res);
}
@ -123,11 +123,11 @@ namespace JsonRx.Api
// newUserRegister.phoneOs = Util.GetDeviceType(Request);
newUserRegister.FullName= newUserRegister.FullName.ToTitleCase(TitleCase.All);
var custRegisterResponse = _requestServices.NewUserRegister(newUserRegister);
Log.Debug("NewUserRegister | RESPONSE : " + JsonConvert.SerializeObject(custRegisterResponse));
return Ok(custRegisterResponse);
}
return ModelValidationError(ModelState);
return ModelValidationError(ModelState,"100");
}
/// <summary>
@ -378,14 +378,14 @@ namespace JsonRx.Api
/// </summary>
/// <param name="modelState"></param>
/// <returns></returns>
protected IHttpActionResult ModelValidationError(ModelStateDictionary modelState)
protected IHttpActionResult ModelValidationError(ModelStateDictionary modelState, string error="")
{
var modelErrors = modelState.Select(x => x.Value.Errors)
.Where(y => y.Count > 0)
.First()[0].ErrorMessage;
JsonRxResponse jsonRx = new JsonRxResponse()
{
ErrorCode = "1",
ErrorCode = error??"1",
Msg = string.IsNullOrEmpty(modelErrors) ? "It seems like incorrect Json input(s)." : modelErrors,
Data = ""
};

14
JsonRx/Api/MobileController.cs

@ -165,7 +165,16 @@ namespace JsonRx.Api
requestOTPModel.DeviceType = Util.GetDeviceType(Request);
requestOTPModel.ProcessId = ProcessId;
Log.Debug("RequestOTP | REQUEST : " + JsonConvert.SerializeObject(requestOTPModel));
var staticDataResponse = _requestServices.RequestOTP(requestOTPModel);
JsonRxResponse staticDataResponse = new JsonRxResponse();
//if (string.IsNullOrEmpty(requestOTPModel.userId))
//{
// staticDataResponse.SetResponse("100", "Email is required!");
// return Ok(staticDataResponse);
//}
staticDataResponse = _requestServices.RequestOTP(requestOTPModel);
return Ok(staticDataResponse);
}
@ -219,6 +228,9 @@ namespace JsonRx.Api
LogicalThreadContext.Properties[LoggerProperty.CREATEDBY] = model.userId ?? model.pCurrency;
LogicalThreadContext.Properties[LoggerProperty.METHODNAME] = "CalculateDefExRate";
LogicalThreadContext.Properties[LoggerProperty.IPADDRESS] = Request.GetClientIpAddress();
model.DeviceType = Util.GetDeviceType(Request);
Log.Debug("CalculateDefExRate | REQUEST : " + JsonConvert.SerializeObject(model));
if (ModelState.IsValid)
{

12
JsonRx/Api/SendMoneyController.cs

@ -135,6 +135,7 @@ namespace JsonRx.Api
LogicalThreadContext.Properties[LoggerProperty.PROCESSID] = pId;
LogicalThreadContext.Properties[LoggerProperty.METHODNAME] = "calculate";
LogicalThreadContext.Properties[LoggerProperty.CREATEDBY] = model.userId;
model.DeviceType= Util.GetDeviceType(Request);
Log.Debug("Calculate | REQUEST : " + JsonConvert.SerializeObject(model));
if (ModelState.IsValid)
{
@ -195,7 +196,7 @@ namespace JsonRx.Api
if (model.DeliveryMethodId == "2" && (model.PAgent == null || model.PAgent == "" || model.PAgent == "0"))
{
res.SetResponse("1", "Bank Id Is Required !");
res.SetResponse("100", "Bank Id Is Required !");
return Ok(res);
}
if (!string.IsNullOrEmpty(model.PurposeOfRemittance) &&
@ -203,17 +204,17 @@ namespace JsonRx.Api
{
if (string.IsNullOrEmpty(model.GoodsOrigin))
{
res.SetResponse("1", "GoodsOrigin is required!");
res.SetResponse("100", "GoodsOrigin is required!");
return Ok(res);
}
if (string.IsNullOrEmpty(model.GoodsType))
{
res.SetResponse("1", "GoodsType is required!");
res.SetResponse("100", "GoodsType is required!");
return Ok(res);
}
if (string.IsNullOrEmpty(model.PortOfShipment))
{
res.SetResponse("1", "PortOfShipment is required!");
res.SetResponse("100", "PortOfShipment is required!");
return Ok(res);
}
@ -231,7 +232,6 @@ namespace JsonRx.Api
{
res = _bussiness.SendTransaction(model);
Log.Debug("DOTRANSACTION | RESPONSE : " + JsonConvert.SerializeObject(res));
Log.Debug("DOTRANSACTION | RESPONSE : " + JsonConvert.SerializeObject(res));
if (res.ErrorCode == "0")
{
@ -270,7 +270,7 @@ namespace JsonRx.Api
}
if (res.ErrorCode.Equals("0"))
{
if (res.Extra3 != null && res.Extra3.ToString() == "N")
if (res.Extra3 != null && res.Extra3.ToString() == "N")
enumString = RESPONSE_MSG.SEND_TRANSACTION_SUCCESS.ToString();
else

80
Repository/Authentication/AuthenticationRepo.cs

@ -129,48 +129,48 @@ namespace Repository.Authentication
ls.ErrorCode = "1";
// ls.Msg = dataTable.Rows[0]["errorCode"] + Convert.ToString(dataTable.Rows[0]["msg"]);
//return ls;
string enumString = string.Empty;
////return ls;
//string enumString = string.Empty;
if (dataTable.Rows[0]["errorCode"].Equals("1"))
{
enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_1.ToString();
}
else if (dataTable.Rows[0]["errorCode"].Equals("2"))
{
enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_2.ToString();
}
else if (dataTable.Rows[0]["errorCode"].Equals("3"))
{
enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_3.ToString();
}
else if (dataTable.Rows[0]["errorCode"].Equals("4"))
{
enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_4.ToString();
}
else if (dataTable.Rows[0]["errorCode"].Equals("5"))
{
enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_5.ToString();
}
else if (dataTable.Rows[0]["errorCode"].Equals("6"))
{
enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_6.ToString();
}
else if (dataTable.Rows[0]["errorCode"].Equals("7"))
{
enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_7.ToString();
}
else if (dataTable.Rows[0]["errorCode"].Equals("8"))
{
enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_8.ToString();
}
else if (dataTable.Rows[0]["errorCode"].Equals("20"))
{
enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_20.ToString();
}
//if (dataTable.Rows[0]["errorCode"].Equals("1"))
//{
// enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_1.ToString();
//}
//else if (dataTable.Rows[0]["errorCode"].Equals("2"))
//{
// enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_2.ToString();
//}
//else if (dataTable.Rows[0]["errorCode"].Equals("3"))
//{
// enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_3.ToString();
//}
//else if (dataTable.Rows[0]["errorCode"].Equals("4"))
//{
// enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_4.ToString();
//}
//else if (dataTable.Rows[0]["errorCode"].Equals("5"))
//{
// enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_5.ToString();
//}
//else if (dataTable.Rows[0]["errorCode"].Equals("6"))
//{
// enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_6.ToString();
//}
//else if (dataTable.Rows[0]["errorCode"].Equals("7"))
//{
// enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_7.ToString();
//}
//else if (dataTable.Rows[0]["errorCode"].Equals("8"))
//{
// enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_8.ToString();
//}
//else if (dataTable.Rows[0]["errorCode"].Equals("20"))
//{
// enumString = RESPONSE_MSG.LOGIN_TO_SYSTEM_FAIL_20.ToString();
//}
var map = Utilities.GetLanguageMapping(enumString, lang);
return new LoginResponse { ErrorCode = dataTable.Rows[0]["errorCode"].Equals("0") ? "0" : "1", Msg = map.Message};
// var map = Utilities.GetLanguageMapping(enumString, lang);
return new LoginResponse { ErrorCode = dataTable.Rows[0]["errorCode"].Equals("0") ? "0" : "1", Msg = Convert.ToString(dataTable.Rows[0]["msg"]) };
//ls.Msg = map.Message;
}

42
Repository/Mobile/MobileServicesRepo.cs

@ -114,13 +114,13 @@ namespace Repository.Mobile
//return new JsonRxResponse
//{
// ErrorCode = _dbRes.ResponseCode,
//Msg = _dbRes.Msg,
//Extra = _dbRes.Id
//};
}
//return new JsonRxResponse
//{
// ErrorCode = _dbRes.ResponseCode,
//Msg = _dbRes.Msg,
//Extra = _dbRes.Id
//};
}
public JsonRxResponse GetNotifyInfo(string customerId)
{
var lang = Convert.ToString(CallContext.GetData(Constants.Language));
@ -214,7 +214,7 @@ namespace Repository.Mobile
{
lst.Add(new KeyValues() { Key = row["detailTitle"].ToString(), Value = row["detailDesc"].ToString() });
}
return lst;
}
public JsonRxResponse SubmitOTP(RequestOTPModel requestOTPModel)
@ -1005,18 +1005,18 @@ namespace Repository.Mobile
accountNo = sRow["accountNo"].ToString(),
payoutBankBranch = sRow["pBranchName"].ToString(),
pAgentBank = sRow["pAgent"].ToString() ?? "[ANY WHERE]",
collAmount = GetStatic.ShowDecimal(sRow["cAmt"].ToString()) + " " + sRow["collCurr"].ToString(),
collAmount = GetStatic.ShowDecimal1(sRow["cAmt"].ToString()) + " " + sRow["collCurr"].ToString(),
exRate = sRow["exRate"].ToString(),
serviceCharge = GetStatic.ShowDecimal(sRow["serviceCharge"].ToString()) + " " + sRow["collCurr"].ToString(),
serviceCharge = GetStatic.ShowDecimal1(sRow["serviceCharge"].ToString()) + " " + sRow["collCurr"].ToString(),
payOutAmount = GetStatic.ShowDecimal(sRow["pAmt"].ToString()) + " " + sRow["payoutCurr"].ToString(),
couponName = sRow["couponName"].ToString(),
discountType = sRow["discountType"].ToString(),
discountValue = sRow["discountValue"].ToString(),
discountPercent = sRow["discountPercent"].ToString(),
tranStatus = sRow["tranStatus"].ToString(),
rewardPoints = sRow["rewardPoints"].ToString(),
rewardPoints = GetStatic.ShowDecimal1(sRow["rewardPoints"].ToString()),
ColorIcon = GetColor(sRow["PayStatus"].ToString()),
SenderFullName = sRow["senderName"].ToString(),
SenderFullName = sRow["senderName"].ToString(),
PaymentDetails = new PaymentDetails()
{
AccountName = "IME LONDON",
@ -1027,7 +1027,7 @@ namespace Repository.Mobile
Reference = sRow["senderName"].ToString(),
SortCode = "04-06-93"
}
};
double discountval = 0, discountpercent = 0;
@ -1337,8 +1337,8 @@ namespace Repository.Mobile
sql += ", @address1 = " + _dao.FilterString(newUserRegister.Address1);
sql += ", @address2 = " + _dao.FilterString(newUserRegister.Address2);
sql += ", @city = " + _dao.FilterString(newUserRegister.City);
sql += ", @gender = " + _dao.FilterString(newUserRegister.Gender);
sql += ", @gender = " + _dao.FilterString(newUserRegister.Gender);
if (!string.IsNullOrEmpty(newUserRegister.FullName))
{
var str = newUserRegister.FullName.Trim().Split(' ');
@ -1668,18 +1668,18 @@ namespace Repository.Mobile
sql += ", @fromDate=" + _dao.FilterString(search.FromDate);
sql += ", @toDate=" + _dao.FilterString(search.ToDate);
Log.DebugFormat("GetWalletStatement | SQL : {0}", sql);
var dt = _dao.ExecuteDataTable(sql);
if (dt == null || dt.Rows.Count == 0)
{
return null;
}
foreach (DataRow dr in dt.Rows)
{
WalletStatementResponse tranHistoryResponse = new WalletStatementResponse()
{
TranId = Convert.ToString(dr["tranId"]),
ControlNo = Convert.ToString(dr["controlNo"]),
CollAmt = Convert.ToString(dr["collAmount"]),
@ -1689,8 +1689,8 @@ namespace Repository.Mobile
PayStatus = Convert.ToString(dr["payStatus"]),
PayoutMode = Convert.ToString(dr["payoutMode"]),
TransactionDate = Convert.ToString(dr["sendDate"]),
ReceiverName= Convert.ToString(dr["ReceiverName"]),
PayoutCountry = Convert.ToString(dr["PayoutCountry"]),
ReceiverName = Convert.ToString(dr["ReceiverName"]),
PayoutCountry = Convert.ToString(dr["PayoutCountry"]),
ColorCode = GetColorCode(dr["payStatus"].ToString()),
TextCode = GetTextCode(dr["payStatus"].ToString()),
};
@ -3130,7 +3130,7 @@ namespace Repository.Mobile
{
CustomerName = row1["CUSTOMER_NAME"].ToString(),
RewardAmount = string.Format("{0:0.##}", row1["REWARD_AMOUNT"].ToString()),
RewardType = row1["REWARD_TYPE"].ToString(),
RewardType = $"{row1["CUSTOMER_NAME"].ToString()} - { row1["REWARD_TYPE"].ToString()}",
DestinationCustomerId = row1["DESTINATION_CUSTOMERID"].ToString(),
CreatedDate = row1["CREATED_DATE"].ToString()
});

Loading…
Cancel
Save