diff --git a/Business/Addressy/LocateBusiness.cs b/Business/Addressy/LocateBusiness.cs new file mode 100644 index 0000000..5d7849d --- /dev/null +++ b/Business/Addressy/LocateBusiness.cs @@ -0,0 +1,110 @@ +using Business.api.addressy; +using Common; +using Common.Model; +using Common.Model.Addressy; +using log4net; +using Repository; +using Repository.Mobile; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Business.Addressy +{ + + public class LocateBusiness + { + private static readonly ILog Log = LogManager.GetLogger(typeof(LocateBusiness)); + + ServiceApi serviceApi { get; set; } + public LocateBusiness() + { + serviceApi = new ServiceApi(); + + + } + + public JsonRxResponse QueryAddress(string postCode) + + { + JsonRxResponse rxResponse = new JsonRxResponse() { ErrorCode = "1", Msg = "No Data found" }; + var results = serviceApi.Find_v1_10(postCode); + + Log.Debug(Newtonsoft.Json.JsonConvert.SerializeObject(results)); + + if (results != null && results.Any()) + { + var single = results.FirstOrDefault(); + if (single != null && single.Type.Equals("Postcode")) + { + rxResponse.ErrorCode = "0"; + rxResponse.Msg = "Post code found"; + + var result2 = serviceApi.Find_v1_10(postCode, single.Id); + + QueryResponse queryResponsse = new QueryResponse(); + + queryResponsse.Addresses = new List
(); + foreach (Capture_Interactive_Find_v1_10_Results item in result2) + { + queryResponsse.Addresses.Add(new Address() + { + Id = item.Id, + Type = item.Type, + Address1 = item.Text, + City = item.Description.Substring(0, item.Description.LastIndexOf(",")) + }); + } + + + rxResponse.Data = queryResponsse; + } + } + else + { + rxResponse.Msg = "No result!"; + } + + return rxResponse; + } + + + public QueryResponse LoadKycStaticData() + { + QueryResponse queryResponse = new QueryResponse(); + var sql = "EXEC proc_mobile_StaticData @flag='Query-Address'"; + + Dao _dao = new Dao(); + var ds = _dao.ExecuteDataset(sql); + + if (ds.Tables.Count == 2) + { + var nativeCountry = ds.Tables[0]; + var ncr = from nc in nativeCountry.AsEnumerable() + select new NativeCountry + { + id = nc.Field("id").ToString(), + text = nc.Field("text"), + code = nc.Field("Code") + }; + queryResponse.NativeCountry = ncr.ToList(); + + var gender = ds.Tables[1]; + var g = from gd in gender.AsEnumerable() + select new Gender + { + id = gd.Field("id").ToString(), + text = gd.Field("text"), + + }; + queryResponse.Gender = g.ToList(); + + } + + return queryResponse; + } + } +} diff --git a/Business/Addressy/ServiceApi.cs b/Business/Addressy/ServiceApi.cs new file mode 100644 index 0000000..2c5e49d --- /dev/null +++ b/Business/Addressy/ServiceApi.cs @@ -0,0 +1,41 @@ +using Business.api.addressy; +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Business.Addressy +{ + + + + public class ServiceApi + { + + public string _key { get; set; } + api.addressy.PostcodeAnywhere_SoapClient _SoapClient { get; set; } + public ServiceApi() + { + _key = ConfigurationManager.AppSettings["loqatekey"].ToString(); + _SoapClient = new api.addressy.PostcodeAnywhere_SoapClient(); + } + + public Capture_Interactive_Find_v1_10_ArrayOfResults Find_v1_10(string search) + { + + return _SoapClient.Capture_Interactive_Find_v1_10(_key, search, true, null, null, "GB", 20, "en-gb", false, "", ""); + + } + + public Capture_Interactive_Find_v1_10_ArrayOfResults Find_v1_10(string search, string container) + { + + return _SoapClient.Capture_Interactive_Find_v1_10(_key, search, true, container, "", "GB", 20, "en-gb", false, "", ""); + + } + + + } + } diff --git a/Business/Business.csproj b/Business/Business.csproj index f76e599..5609c49 100644 --- a/Business/Business.csproj +++ b/Business/Business.csproj @@ -61,6 +61,8 @@ ..\packages\Microsoft.Net.Http.2.2.29\lib\net45\System.Net.Http.Primitives.dll + + @@ -73,12 +75,19 @@ + + + + True + True + Reference.svcmap + @@ -135,6 +144,13 @@ + + Reference.svcmap + + + Reference.svcmap + + Designer @@ -142,7 +158,21 @@ - + + + + + + + + + + + + WCF Proxy Generator + Reference.cs + + diff --git a/Business/Connected Services/api.addressy/Business.api.addressy.Capture_Interactive_Find_v1_10Response.datasource b/Business/Connected Services/api.addressy/Business.api.addressy.Capture_Interactive_Find_v1_10Response.datasource new file mode 100644 index 0000000..b9f7662 --- /dev/null +++ b/Business/Connected Services/api.addressy/Business.api.addressy.Capture_Interactive_Find_v1_10Response.datasource @@ -0,0 +1,10 @@ + + + + Business.api.addressy.Capture_Interactive_Find_v1_10Response, Connected Services.api.addressy.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/Business/Connected Services/api.addressy/Business.api.addressy.Capture_Interactive_Find_v1_10_ArrayOfResults.datasource b/Business/Connected Services/api.addressy/Business.api.addressy.Capture_Interactive_Find_v1_10_ArrayOfResults.datasource new file mode 100644 index 0000000..b9ae39c --- /dev/null +++ b/Business/Connected Services/api.addressy/Business.api.addressy.Capture_Interactive_Find_v1_10_ArrayOfResults.datasource @@ -0,0 +1,10 @@ + + + + Business.api.addressy.Capture_Interactive_Find_v1_10_ArrayOfResults, Connected Services.api.addressy.Reference.cs.dll, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + \ No newline at end of file diff --git a/Business/Connected Services/api.addressy/Reference.cs b/Business/Connected Services/api.addressy/Reference.cs new file mode 100644 index 0000000..5197e85 --- /dev/null +++ b/Business/Connected Services/api.addressy/Reference.cs @@ -0,0 +1,288 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Business.api.addressy { + using System.Runtime.Serialization; + using System; + + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] + [System.Runtime.Serialization.CollectionDataContractAttribute(Name="Capture_Interactive_Find_v1_10_ArrayOfResults", Namespace="http://services.postcodeanywhere.co.uk/", ItemName="Capture_Interactive_Find_v1_10_Results")] + [System.SerializableAttribute()] + public class Capture_Interactive_Find_v1_10_ArrayOfResults : System.Collections.Generic.List { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "4.0.0.0")] + [System.Runtime.Serialization.DataContractAttribute(Name="Capture_Interactive_Find_v1_10_Results", Namespace="http://services.postcodeanywhere.co.uk/")] + [System.SerializableAttribute()] + public partial class Capture_Interactive_Find_v1_10_Results : object, System.Runtime.Serialization.IExtensibleDataObject, System.ComponentModel.INotifyPropertyChanged { + + [System.NonSerializedAttribute()] + private System.Runtime.Serialization.ExtensionDataObject extensionDataField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string IdField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string TypeField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string TextField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string HighlightField; + + [System.Runtime.Serialization.OptionalFieldAttribute()] + private string DescriptionField; + + [global::System.ComponentModel.BrowsableAttribute(false)] + public System.Runtime.Serialization.ExtensionDataObject ExtensionData { + get { + return this.extensionDataField; + } + set { + this.extensionDataField = value; + } + } + + [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false)] + public string Id { + get { + return this.IdField; + } + set { + if ((object.ReferenceEquals(this.IdField, value) != true)) { + this.IdField = value; + this.RaisePropertyChanged("Id"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false)] + public string Type { + get { + return this.TypeField; + } + set { + if ((object.ReferenceEquals(this.TypeField, value) != true)) { + this.TypeField = value; + this.RaisePropertyChanged("Type"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=2)] + public string Text { + get { + return this.TextField; + } + set { + if ((object.ReferenceEquals(this.TextField, value) != true)) { + this.TextField = value; + this.RaisePropertyChanged("Text"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=3)] + public string Highlight { + get { + return this.HighlightField; + } + set { + if ((object.ReferenceEquals(this.HighlightField, value) != true)) { + this.HighlightField = value; + this.RaisePropertyChanged("Highlight"); + } + } + } + + [System.Runtime.Serialization.DataMemberAttribute(EmitDefaultValue=false, Order=4)] + public string Description { + get { + return this.DescriptionField; + } + set { + if ((object.ReferenceEquals(this.DescriptionField, value) != true)) { + this.DescriptionField = value; + this.RaisePropertyChanged("Description"); + } + } + } + + public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; + + protected void RaisePropertyChanged(string propertyName) { + System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged; + if ((propertyChanged != null)) { + propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); + } + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ServiceModel.ServiceContractAttribute(Namespace="http://services.postcodeanywhere.co.uk/", ConfigurationName="api.addressy.PostcodeAnywhere_Soap")] + public interface PostcodeAnywhere_Soap { + + // CODEGEN: Generating message contract since the wrapper name (Capture_Interactive_Find_v1_10_Response) of message Capture_Interactive_Find_v1_10Response does not match the default value (Capture_Interactive_Find_v1_10) + [System.ServiceModel.OperationContractAttribute(Action="http://services.postcodeanywhere.co.uk/Capture_Interactive_Find_v1_10", ReplyAction="*")] + Business.api.addressy.Capture_Interactive_Find_v1_10Response Capture_Interactive_Find_v1_10(Business.api.addressy.Capture_Interactive_Find_v1_10Request request); + + [System.ServiceModel.OperationContractAttribute(Action="http://services.postcodeanywhere.co.uk/Capture_Interactive_Find_v1_10", ReplyAction="*")] + System.Threading.Tasks.Task Capture_Interactive_Find_v1_10Async(Business.api.addressy.Capture_Interactive_Find_v1_10Request request); + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="Capture_Interactive_Find_v1_10", WrapperNamespace="http://services.postcodeanywhere.co.uk/", IsWrapped=true)] + public partial class Capture_Interactive_Find_v1_10Request { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://services.postcodeanywhere.co.uk/", Order=0)] + public string Key; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://services.postcodeanywhere.co.uk/", Order=1)] + public string Text; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://services.postcodeanywhere.co.uk/", Order=2)] + public bool IsMiddleware; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://services.postcodeanywhere.co.uk/", Order=3)] + public string Container; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://services.postcodeanywhere.co.uk/", Order=4)] + public string Origin; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://services.postcodeanywhere.co.uk/", Order=5)] + public string Countries; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://services.postcodeanywhere.co.uk/", Order=6)] + public int Limit; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://services.postcodeanywhere.co.uk/", Order=7)] + public string Language; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://services.postcodeanywhere.co.uk/", Order=8)] + public bool Bias; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://services.postcodeanywhere.co.uk/", Order=9)] + public string Filters; + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://services.postcodeanywhere.co.uk/", Order=10)] + public string GeoFence; + + public Capture_Interactive_Find_v1_10Request() { + } + + public Capture_Interactive_Find_v1_10Request(string Key, string Text, bool IsMiddleware, string Container, string Origin, string Countries, int Limit, string Language, bool Bias, string Filters, string GeoFence) { + this.Key = Key; + this.Text = Text; + this.IsMiddleware = IsMiddleware; + this.Container = Container; + this.Origin = Origin; + this.Countries = Countries; + this.Limit = Limit; + this.Language = Language; + this.Bias = Bias; + this.Filters = Filters; + this.GeoFence = GeoFence; + } + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + [System.ServiceModel.MessageContractAttribute(WrapperName="Capture_Interactive_Find_v1_10_Response", WrapperNamespace="http://services.postcodeanywhere.co.uk/", IsWrapped=true)] + public partial class Capture_Interactive_Find_v1_10Response { + + [System.ServiceModel.MessageBodyMemberAttribute(Namespace="http://services.postcodeanywhere.co.uk/", Order=0)] + public Business.api.addressy.Capture_Interactive_Find_v1_10_ArrayOfResults Capture_Interactive_Find_v1_10_Result; + + public Capture_Interactive_Find_v1_10Response() { + } + + public Capture_Interactive_Find_v1_10Response(Business.api.addressy.Capture_Interactive_Find_v1_10_ArrayOfResults Capture_Interactive_Find_v1_10_Result) { + this.Capture_Interactive_Find_v1_10_Result = Capture_Interactive_Find_v1_10_Result; + } + } + + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public interface PostcodeAnywhere_SoapChannel : Business.api.addressy.PostcodeAnywhere_Soap, System.ServiceModel.IClientChannel { + } + + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")] + public partial class PostcodeAnywhere_SoapClient : System.ServiceModel.ClientBase, Business.api.addressy.PostcodeAnywhere_Soap { + + public PostcodeAnywhere_SoapClient() { + } + + public PostcodeAnywhere_SoapClient(string endpointConfigurationName) : + base(endpointConfigurationName) { + } + + public PostcodeAnywhere_SoapClient(string endpointConfigurationName, string remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public PostcodeAnywhere_SoapClient(string endpointConfigurationName, System.ServiceModel.EndpointAddress remoteAddress) : + base(endpointConfigurationName, remoteAddress) { + } + + public PostcodeAnywhere_SoapClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : + base(binding, remoteAddress) { + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + Business.api.addressy.Capture_Interactive_Find_v1_10Response Business.api.addressy.PostcodeAnywhere_Soap.Capture_Interactive_Find_v1_10(Business.api.addressy.Capture_Interactive_Find_v1_10Request request) { + return base.Channel.Capture_Interactive_Find_v1_10(request); + } + + public Business.api.addressy.Capture_Interactive_Find_v1_10_ArrayOfResults Capture_Interactive_Find_v1_10(string Key, string Text, bool IsMiddleware, string Container, string Origin, string Countries, int Limit, string Language, bool Bias, string Filters, string GeoFence) { + Business.api.addressy.Capture_Interactive_Find_v1_10Request inValue = new Business.api.addressy.Capture_Interactive_Find_v1_10Request(); + inValue.Key = Key; + inValue.Text = Text; + inValue.IsMiddleware = IsMiddleware; + inValue.Container = Container; + inValue.Origin = Origin; + inValue.Countries = Countries; + inValue.Limit = Limit; + inValue.Language = Language; + inValue.Bias = Bias; + inValue.Filters = Filters; + inValue.GeoFence = GeoFence; + Business.api.addressy.Capture_Interactive_Find_v1_10Response retVal = ((Business.api.addressy.PostcodeAnywhere_Soap)(this)).Capture_Interactive_Find_v1_10(inValue); + return retVal.Capture_Interactive_Find_v1_10_Result; + } + + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] + System.Threading.Tasks.Task Business.api.addressy.PostcodeAnywhere_Soap.Capture_Interactive_Find_v1_10Async(Business.api.addressy.Capture_Interactive_Find_v1_10Request request) { + return base.Channel.Capture_Interactive_Find_v1_10Async(request); + } + + public System.Threading.Tasks.Task Capture_Interactive_Find_v1_10Async(string Key, string Text, bool IsMiddleware, string Container, string Origin, string Countries, int Limit, string Language, bool Bias, string Filters, string GeoFence) { + Business.api.addressy.Capture_Interactive_Find_v1_10Request inValue = new Business.api.addressy.Capture_Interactive_Find_v1_10Request(); + inValue.Key = Key; + inValue.Text = Text; + inValue.IsMiddleware = IsMiddleware; + inValue.Container = Container; + inValue.Origin = Origin; + inValue.Countries = Countries; + inValue.Limit = Limit; + inValue.Language = Language; + inValue.Bias = Bias; + inValue.Filters = Filters; + inValue.GeoFence = GeoFence; + return ((Business.api.addressy.PostcodeAnywhere_Soap)(this)).Capture_Interactive_Find_v1_10Async(inValue); + } + } +} diff --git a/Business/Connected Services/api.addressy/Reference.svcmap b/Business/Connected Services/api.addressy/Reference.svcmap new file mode 100644 index 0000000..4fa5506 --- /dev/null +++ b/Business/Connected Services/api.addressy/Reference.svcmap @@ -0,0 +1,31 @@ + + + + false + true + true + + false + false + false + + + true + Auto + true + true + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Business/Connected Services/api.addressy/configuration.svcinfo b/Business/Connected Services/api.addressy/configuration.svcinfo new file mode 100644 index 0000000..324764b --- /dev/null +++ b/Business/Connected Services/api.addressy/configuration.svcinfo @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Business/Connected Services/api.addressy/configuration91.svcinfo b/Business/Connected Services/api.addressy/configuration91.svcinfo new file mode 100644 index 0000000..5d4ec46 --- /dev/null +++ b/Business/Connected Services/api.addressy/configuration91.svcinfo @@ -0,0 +1,201 @@ + + + + + + + PostcodeAnywhere_Soap + + + + + + + + + + + + + + + + + + + + + StrongWildcard + + + + + + 65536 + + + + + + + + + System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + System.Text.UTF8Encoding + + + Buffered + + + + + + Text + + + System.ServiceModel.Configuration.BasicHttpSecurityElement + + + None + + + System.ServiceModel.Configuration.HttpTransportSecurityElement + + + None + + + None + + + System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement + + + Never + + + TransportSelected + + + (Collection) + + + + + + System.ServiceModel.Configuration.BasicHttpMessageSecurityElement + + + UserName + + + Default + + + + + + + + + http://services.postcodeanywhere.co.uk/Capture/Interactive/Find/v1.10/soapnew.ws + + + + + + basicHttpBinding + + + PostcodeAnywhere_Soap + + + api.addressy.PostcodeAnywhere_Soap + + + System.ServiceModel.Configuration.AddressHeaderCollectionElement + + + <Header /> + + + System.ServiceModel.Configuration.IdentityElement + + + System.ServiceModel.Configuration.UserPrincipalNameElement + + + + + + System.ServiceModel.Configuration.ServicePrincipalNameElement + + + + + + System.ServiceModel.Configuration.DnsElement + + + + + + System.ServiceModel.Configuration.RsaElement + + + + + + System.ServiceModel.Configuration.CertificateElement + + + + + + System.ServiceModel.Configuration.CertificateReferenceElement + + + My + + + LocalMachine + + + FindBySubjectDistinguishedName + + + + + + False + + + PostcodeAnywhere_Soap + + + + + + + + + + + \ No newline at end of file diff --git a/Business/Connected Services/api.addressy/wsdlnew.wsdl b/Business/Connected Services/api.addressy/wsdlnew.wsdl new file mode 100644 index 0000000..dc76a54 --- /dev/null +++ b/Business/Connected Services/api.addressy/wsdlnew.wsdl @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Business/Mobile/IMobileServices.cs b/Business/Mobile/IMobileServices.cs index d9e3b72..25afb7e 100644 --- a/Business/Mobile/IMobileServices.cs +++ b/Business/Mobile/IMobileServices.cs @@ -95,5 +95,7 @@ namespace Business.Mobile JsonRxResponse GetFieldsByProduct(MappingType type, string customer); JsonRxResponse ValidateReferralCode(string referralCode); + + //JsonRxResponse QueryAddress(string postCode); } } \ No newline at end of file diff --git a/Business/Mobile/MobileServices.cs b/Business/Mobile/MobileServices.cs index a969655..381b3f3 100644 --- a/Business/Mobile/MobileServices.cs +++ b/Business/Mobile/MobileServices.cs @@ -31,6 +31,7 @@ using System.Collections; using Repository; using System.Configuration; using Business.TrustDoc; +using Business.Addressy; namespace Business.Mobile { @@ -308,37 +309,13 @@ namespace Business.Mobile var lang = Convert.ToString(CallContext.GetData(Constants.Language)); string enumString = string.Empty; - if (response.ErrorCode.Equals("3")) - { - enumString = RESPONSE_MSG.CALCULATE_AMOUNT_FAIL_3.ToString(); - } - else if (response.ErrorCode.Equals("4")) - { - enumString = RESPONSE_MSG.CALCULATE_AMOUNT_FAIL_4.ToString(); - } - else if (response.ErrorCode.Equals("6")) - { - enumString = RESPONSE_MSG.CALCULATE_AMOUNT_FAIL_6.ToString(); - } - else if (response.ErrorCode.Equals("7")) - { - enumString = RESPONSE_MSG.CALCULATE_AMOUNT_FAIL_7.ToString(); - } - else if (response.ErrorCode.Equals("8")) - { - enumString = RESPONSE_MSG.CALCULATE_AMOUNT_FAIL_7.ToString(); - } - else if (response.ErrorCode.Equals("9")) - { - enumString = RESPONSE_MSG.CALCULATE_AMOUNT_FAIL_7.ToString(); - } - var map = Utilities.GetLanguageMapping(enumString, lang); + response.FootNoteMessage = response.ErrorCode.Equals("0") ? Utilities.GetLanguageMapping(ConfigurationManager.AppSettings["footNote_calculateDashboard"].ToString(), lang).Message : ""; - return new JsonRxResponse { ErrorCode = response.ErrorCode.Equals("0") ? "0" : "1", Msg = map.Message, Id = response.Id, Extra = response.Extra, Data = response.Data, Extra2 = response.Extra2, FootNoteMessage = response.FootNoteMessage }; - // return response; + //return new JsonRxResponse { ErrorCode = response.ErrorCode.Equals("0") ? "0" : "1", Msg = map.Message, Id = response.Id, Extra = response.Extra, Data = response.Data, Extra2 = response.Extra2, FootNoteMessage = response.FootNoteMessage }; + return response; } catch (Exception ex) { @@ -528,6 +505,14 @@ namespace Business.Mobile try { var httpRequest = HttpContext.Current.Request; + + var idFrontUrl = httpRequest.Files["idFront"]; + var idBackUrl = httpRequest.Files["idBack"]; + var idSideUrl = httpRequest.Files["idSide"]; + var additionalIdUrl = httpRequest.Files["additionalId"]; + var additionalIdBackUrl = httpRequest.Files["additionalIdBack"]; + var facePictureUrl = httpRequest.Files["faceImageFile"]; + var custKyc = new CustomerKYCModel() { userId = httpRequest["userId"], @@ -546,6 +531,11 @@ namespace Business.Mobile RegistrationType = httpRequest["RegistrationType"] != null ? httpRequest["RegistrationType"] : "", TrustDocId = httpRequest["TrustDocId"] != null ? httpRequest["TrustDocId"] : "", customerType = httpRequest["customerType"], + idFront = idFrontUrl != null ? idFrontUrl.FileName : "", + idBack = idBackUrl != null ? idBackUrl.FileName : "", + additionalId = additionalIdUrl != null ? additionalIdUrl.FileName : "", + additionalIdBack = additionalIdBackUrl != null ? additionalIdBackUrl.FileName : "", + }; if (deviceType.ToLower().Equals("ios") & !string.IsNullOrEmpty(custKyc.customerType)) @@ -557,12 +547,7 @@ namespace Business.Mobile custKyc.idType = custKyc.customerType; } - var idFrontUrl = httpRequest.Files["idFront"]; - var idBackUrl = httpRequest.Files["idBack"]; - var idSideUrl = httpRequest.Files["idSide"]; - var additionalIdUrl = httpRequest.Files["additionalId"]; - var additionalIdBackUrl = httpRequest.Files["additionalIdBack"]; - var facePictureUrl = httpRequest.Files["faceImageFile"]; + if (!string.IsNullOrEmpty(custKyc.RegistrationType) && custKyc.RegistrationType.Equals("EKYC")) @@ -571,15 +556,15 @@ namespace Business.Mobile } var isBackRequired = "0"; - if (httpRequest.Files.Count > 0 && Utilities.IsCheckAdditionalId()) - { - var id = _requestServices.checkAdditionalId(custKyc.additionalIdType); - if (id != null) - { - isBackRequired = id["isBackRequired"].ToString(); - } - } - Log.Debug($"RegisterKYC | REQUEST : { JsonConvert.SerializeObject(custKyc)} | isBackRequired : {isBackRequired} | Files: { httpRequest.Files.Count}"); + //if (httpRequest.Files.Count > 0 && Utilities.IsCheckAdditionalId()) + //{ + // var id = _requestServices.checkAdditionalId(custKyc.additionalIdType); + // if (id != null) + // { + // isBackRequired = id["isBackRequired"].ToString(); + // } + //} + Log.Debug($"RegisterKYC | REQUEST : { JsonConvert.SerializeObject(custKyc)} | Files: { httpRequest.Files.Count}"); //if (httpRequest.Files.Count <= 1) //documents @@ -882,83 +867,83 @@ namespace Business.Mobile Log.Debug("IsValidatedForm | Requested parameters : " + JsonConvert.SerializeObject(kyc)); //NULL validation - var jsonRxMobile = ValidateMobile(kyc.mobile); - - if (!jsonRxMobile.ErrorCode.Equals("0")) - { - Log.Debug($"RegisterKYC | Mobile : {kyc.mobile} | ValidateMobile failed : { JsonConvert.SerializeObject(jsonRxMobile)}"); - jsonRx.SetResponse("1", jsonRxMobile.Msg); - return jsonRx; - } - else - { - Log.Debug($"RegisterKYC | ValidateMobile Response : { JsonConvert.SerializeObject(jsonRxMobile)}"); - kyc.mobile = jsonRxMobile.Extra; - } + //var jsonRxMobile = ValidateMobile(kyc.mobile); + //if (!jsonRxMobile.ErrorCode.Equals("0")) + //{ + // Log.Debug($"RegisterKYC | Mobile : {kyc.mobile} | ValidateMobile failed : { JsonConvert.SerializeObject(jsonRxMobile)}"); + // jsonRx.SetResponse("1", jsonRxMobile.Msg); + // return jsonRx; + //} + //else + //{ + // Log.Debug($"RegisterKYC | ValidateMobile Response : { JsonConvert.SerializeObject(jsonRxMobile)}"); + // kyc.mobile = jsonRxMobile.Extra; + //} - if (string.IsNullOrEmpty(kyc.otherOccupation) && string.IsNullOrEmpty(kyc.occupation)) - { - enumString = RESPONSE_MSG.VALIDATE_FORM_2.ToString(); - var map = Utilities.GetLanguageMapping(enumString, lang); - jsonRx.SetResponse("1", map.Message); - return jsonRx; - } - else if (string.IsNullOrEmpty(kyc.occupation)) - { - if (string.IsNullOrEmpty(kyc.otherOccupation)) - { - enumString = RESPONSE_MSG.VALIDATE_FORM_9.ToString(); - var map = Utilities.GetLanguageMapping(enumString, lang); - jsonRx.SetResponse("1", map.Message); + //if (string.IsNullOrEmpty(kyc.otherOccupation) && string.IsNullOrEmpty(kyc.occupation)) + //{ + // enumString = RESPONSE_MSG.VALIDATE_FORM_2.ToString(); + // var map = Utilities.GetLanguageMapping(enumString, lang); + // jsonRx.SetResponse("1", map.Message); - return jsonRx; - } - } + // return jsonRx; + //} + //else if (string.IsNullOrEmpty(kyc.occupation)) + //{ + // if (string.IsNullOrEmpty(kyc.otherOccupation)) + // { + // enumString = RESPONSE_MSG.VALIDATE_FORM_9.ToString(); + // var map = Utilities.GetLanguageMapping(enumString, lang); + // jsonRx.SetResponse("1", map.Message); + + // return jsonRx; + // } + //} - if (string.IsNullOrEmpty(kyc.monthlyIncome)) - { - enumString = RESPONSE_MSG.VALIDATE_FORM_3.ToString(); - var map = Utilities.GetLanguageMapping(enumString, lang); - jsonRx.SetResponse("1", map.Message); - return jsonRx; - } - if (string.IsNullOrEmpty(kyc.additionalAddress)) - { - enumString = RESPONSE_MSG.VALIDATE_FORM_4.ToString(); - var map = Utilities.GetLanguageMapping(enumString, lang); - jsonRx.SetResponse("1", map.Message); - return jsonRx; - } - if (kyc.additionalAddress.Length > 50) - { - enumString = RESPONSE_MSG.VALIDATE_FORM_11.ToString(); - var map = Utilities.GetLanguageMapping(enumString, lang); - jsonRx.SetResponse("1", map.Message); - return jsonRx; - } - if (string.IsNullOrEmpty(kyc.businessType)) - { - enumString = RESPONSE_MSG.VALIDATE_FORM_5.ToString(); - var map = Utilities.GetLanguageMapping(enumString, lang); - jsonRx.SetResponse("1", map.Message); - return jsonRx; - } - if (string.IsNullOrEmpty(kyc.mobile)) - { - enumString = RESPONSE_MSG.VALIDATE_FORM_6.ToString(); - var map = Utilities.GetLanguageMapping(enumString, lang); - jsonRx.SetResponse("1", map.Message); - return jsonRx; - } - if (string.IsNullOrEmpty(kyc.purposeOfRegistration)) - { - enumString = RESPONSE_MSG.VALIDATE_FORM_7.ToString(); - var map = Utilities.GetLanguageMapping(enumString, lang); - jsonRx.SetResponse("1", map.Message); - return jsonRx; - } + //if (string.IsNullOrEmpty(kyc.monthlyIncome)) + //{ + // enumString = RESPONSE_MSG.VALIDATE_FORM_3.ToString(); + // var map = Utilities.GetLanguageMapping(enumString, lang); + // jsonRx.SetResponse("1", map.Message); + // return jsonRx; + //} + //if (string.IsNullOrEmpty(kyc.additionalAddress)) + //{ + // enumString = RESPONSE_MSG.VALIDATE_FORM_4.ToString(); + // var map = Utilities.GetLanguageMapping(enumString, lang); + // jsonRx.SetResponse("1", map.Message); + // return jsonRx; + //} + //if (kyc.additionalAddress.Length > 50) + //{ + // enumString = RESPONSE_MSG.VALIDATE_FORM_11.ToString(); + // var map = Utilities.GetLanguageMapping(enumString, lang); + // jsonRx.SetResponse("1", map.Message); + // return jsonRx; + //} + //if (string.IsNullOrEmpty(kyc.businessType)) + //{ + // enumString = RESPONSE_MSG.VALIDATE_FORM_5.ToString(); + // var map = Utilities.GetLanguageMapping(enumString, lang); + // jsonRx.SetResponse("1", map.Message); + // return jsonRx; + //} + //if (string.IsNullOrEmpty(kyc.mobile)) + //{ + // enumString = RESPONSE_MSG.VALIDATE_FORM_6.ToString(); + // var map = Utilities.GetLanguageMapping(enumString, lang); + // jsonRx.SetResponse("1", map.Message); + // return jsonRx; + //} + //if (string.IsNullOrEmpty(kyc.purposeOfRegistration)) + //{ + // enumString = RESPONSE_MSG.VALIDATE_FORM_7.ToString(); + // var map = Utilities.GetLanguageMapping(enumString, lang); + // jsonRx.SetResponse("1", map.Message); + // return jsonRx; + //} if (!isEkyc && string.IsNullOrEmpty(kyc.idType)) { @@ -1211,6 +1196,24 @@ namespace Business.Mobile jsonRx.SetResponse("1", "Error occured", null); return jsonRx; } + else if (type.ToLower().Equals("login-kyc")) + { + LocateBusiness locateBusiness = new LocateBusiness(); + var r = locateBusiness.LoadKycStaticData(); + if (r != null) + { + jsonRx.ErrorCode = "0"; + jsonRx.Msg = "success"; + jsonRx.Data = r; + Log.Debug("LoadFormStaticData-login-kyc | DB RESPONSE : " + JsonConvert.SerializeObject(jsonRx)); + + return jsonRx; + } + Log.Debug("LoadFormStaticData | Returning null while calling DB"); + jsonRx.SetResponse("1", "Error occured", null); + return jsonRx; + } + Log.Debug("LoadFormStaticData | Error occurred while specifying the type, Type mismatch error."); return jsonRx; } @@ -2751,6 +2754,8 @@ namespace Business.Mobile else if (type == Common.Model.Config.MappingType.REWARD_POINT) { var response1 = _requestServices.GetRewardFee(customerId); + response1.PaymentOptions = new PaymentOptions() { Options = Utilities.GetPaymetMethods(), HeaderText="How do like to pay?" }; + if (response1 != null) { Log.Debug("GetFieldsByProduct | DB RESPONSE SUCCESS!"); diff --git a/Business/app.config b/Business/app.config index e936cc1..3b6a6f9 100644 --- a/Business/app.config +++ b/Business/app.config @@ -8,4 +8,17 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/Checklist.txt b/Checklist.txt new file mode 100644 index 0000000..989565d --- /dev/null +++ b/Checklist.txt @@ -0,0 +1,6 @@ +EXEC mobile_proc_GetCalculation @flag='get-exRateDetails' +check sagentid + +change + + diff --git a/Common/Common.csproj b/Common/Common.csproj index cff85f6..2784bae 100644 --- a/Common/Common.csproj +++ b/Common/Common.csproj @@ -73,6 +73,8 @@ + + diff --git a/Common/Helper/Utilities.cs b/Common/Helper/Utilities.cs index ceece0b..0d38116 100644 --- a/Common/Helper/Utilities.cs +++ b/Common/Helper/Utilities.cs @@ -795,19 +795,24 @@ namespace Common.Helper dt.Config = referenceMaps.Config.Where(x => x.DeviceType.ToLower().Equals(obj.DeviceType.ToLower())).SingleOrDefault(); } - if (!string.IsNullOrEmpty(obj.CustomerType)) - { - if (obj.CustomerType.Equals("RESIDENCE")) - obj.CustomerType = "RESIDENT"; - dt.Options = referenceMaps.Options.Where(x => x.CustomerType.ToLower().Equals(obj.CustomerType.ToLower())).ToList(); - } - else - { + dt.Options = referenceMaps.Options; + + return dt; + } + public static List