public bool InsertTransaction(TransactionModel.TransactionData TransactionDetail, string UserID) { transactionEntities = new TransactionEntities(); try { var config = new MapperConfiguration( cfg => { cfg.CreateMap <TransactionModel.TransactionData, Data.Transaction>() .ForMember(x => x.TransStartDate, y => y.MapFrom(z => z.StartDate)) .ForMember(x => x.TransEndDate, y => y.MapFrom(z => z.EndDate)); } ); var mapper = config.CreateMapper(); var transaction = mapper.Map <Data.Transaction>(TransactionDetail); transactionEntities.Transactions.Add(transaction); transactionEntities.SaveChanges(); result = true; } catch (Exception ex) { log = new Logger(); log.LogError(UserID, "DataSolutions.Data", "InsertUser", ex.Message); } return(result); }
public async Task <bool> GetConsumerProfile(TransunionRequest.RequestTrans01 Request, string UserID, int ProductID) { startDate = DateTime.Now; log = new Logger(); try { var config = new MapperConfiguration( cfg => { cfg.CreateMap <RequestTrans01, BureauEnquiry13>() .ForMember(x => x.ul_long_score, y => y.MapFrom(z => z.LongScore)) .ForMember(x => x.ul_medium_score, y => y.MapFrom(z => z.MediumScore)) .ForMember(x => x.ul_short_score, y => y.MapFrom(z => z.ShortScore)) .ForMember(x => x.ul_average_score, y => y.MapFrom(z => z.AverageScore)); } ); var mapper = config.CreateMapper(); var enquiry13 = mapper.Map <BureauEnquiry13>(Request); enquiry13.SecurityCode = securityCode; enquiry13.SubscriberCode = subNo; enquiry13.EnquirerContactName = "Prelen Nair"; enquiry13.EnquirerContactPhoneNo = "083225398"; var response = await client.ProcessRequestTrans13Async(enquiry13); result = response.ErrorCode == null ? true : false; if (!result) { log.LogError(UserID, "DataSolutions.Web", "TransUnionConsumer.GetConsumerProfile", response.ErrorCode + " " + response.ErrorMessage); } //log transaction endDate = DateTime.Now; transData = new TransactionModel.TransactionData { EndDate = endDate, IsSuccessful = result, Message = response.ErrorMessage, ProductID = ProductID, StartDate = startDate, UserID = Convert.ToInt32(UserID) }; SaveTransaction(transData); } catch (Exception ex) { log.LogError(UserID, "DataSolutions.Web", "TransUnionConsumer.GetConsumerProfile", ex.Message); } return(result); }
public async Task <string> BusinessSearch(BusinessSearchRequest Request, int UserID, int ProductID) { bool result = false; string itNumber = string.Empty; try { var config = new MapperConfiguration( cfg => { cfg.CreateMap <BusinessSearchRequest, BusinessSearch>(); } ); var mapper = config.CreateMapper(); var business = mapper.Map <BusinessSearch>(Request); business.SubscriberCode = subNo; business.SecurityCode = securityCode; var response = await client.BusinessSearchAsync(business); result = response.ErrorCode == null ? true : false; if (result) { if (response.FirstResponse != null) { itNumber = response.FirstResponse.ITNumber; } } else { log.LogError(UserID.ToString(), "DataSolution.Services", "BMSRetrieveAlert", response.ErrorCode + ":" + response.ErrorMessage); } //log transaction endDate = DateTime.Now; transData = new TransactionModel.TransactionData { EndDate = endDate, IsSuccessful = result, Message = response.ErrorMessage, ProductID = ProductID, StartDate = startDate, UserID = Convert.ToInt32(UserID) }; SaveTransaction(transData); } catch (Exception ex) { log.LogError(UserID.ToString(), "DataSolutions.Web", "TransUnionCommercialService.BusinessSearch", ex.Message); } return(itNumber); }
public async Task <bool> GetMailboxList(MailboxRequest Request, int UserID, int ProductID) { bool result = false; try { var config = new MapperConfiguration( cfg => { cfg.CreateMap <MailboxRequest, MailboxList>(); } ); var mapper = config.CreateMapper(); var mailbox = mapper.Map <MailboxList>(Request); var response = await client.MailboxListAsync(mailbox); result = response.ErrorCode.Trim() != string.Empty ? true : false; if (!result) { log.LogError(UserID.ToString(), "DataSolution.Services", "GetMailboxList", response.ErrorCode + ":" + response.ErrorMessage); } //log transaction endDate = DateTime.Now; transData = new TransactionModel.TransactionData { EndDate = endDate, IsSuccessful = result, Message = response.ErrorMessage, ProductID = ProductID, StartDate = startDate, UserID = Convert.ToInt32(UserID) }; SaveTransaction(transData); } catch (Exception ex) { log.LogError(UserID.ToString(), "DataSolutions.Web", "TransUnionCommercialService.GetMailboxList", ex.Message); } return(result); }
public async Task <bool> ForensicRequest(ForensicRequest Request, int UserID, int ProductID) { bool result = false; try { var config = new MapperConfiguration( cfg => { cfg.CreateMap <ForensicRequest, ForensicEnquiry>() .ForMember(x => x.RSAIdNo, y => y.MapFrom(z => z.IDNumber)); } ); var mapper = config.CreateMapper(); var forensic = mapper.Map <ForensicEnquiry>(Request); forensic.SubscriberCode = subNo; forensic.SecurityCode = securityCode; var response = await client.ForensicEnquiryRequestAsync(forensic); result = response.ErrorCode.Trim() != string.Empty ? true : false; if (!result) { log.LogError(UserID.ToString(), "DataSolution.Services", "ForensicRequest", response.ErrorCode + ":" + response.ErrorMessage); } //log transaction endDate = DateTime.Now; transData = new TransactionModel.TransactionData { EndDate = endDate, IsSuccessful = result, Message = response.ErrorMessage, ProductID = ProductID, StartDate = startDate, UserID = Convert.ToInt32(UserID) }; SaveTransaction(transData); } catch (Exception ex) { log.LogError(UserID.ToString(), "DataSolutions.Web", "TransUnionCommercialService.BusinessSearch", ex.Message); } return(result); }
public async Task <bool> ProcessTrasaction32(RequestTrans32 Request, int UserID, int ProductID) { bool result = false; try { var config = new MapperConfiguration( cfg => { cfg.CreateMap <RequestTrans32, Transaction32>(); } ); var trans01 = config.CreateMapper().Map <Transaction32>(Request); trans01.SecurityCode = securityCode; trans01.SubscriberCode = subNo; var response = await client.Transaction32Async(trans01); if (!result) { log.LogError(UserID.ToString(), "DataSolution.Services", "ProcessTrasaction32", response.ErrorCode + ":" + response.ErrorMessage); } //log transaction endDate = DateTime.Now; transData = new TransactionModel.TransactionData { EndDate = endDate, IsSuccessful = result, Message = response.ErrorMessage, ProductID = ProductID, StartDate = startDate, UserID = Convert.ToInt32(UserID) }; SaveTransaction(transData); } catch (Exception ex) { log.LogError(UserID.ToString(), "DataSolutions.Web", "TransUnionCommercialService.ProcessTrasaction32", ex.Message); } return(result); }
public async Task <bool> ProcessTrasactionA1(RequestTrans15 Request, int UserID, int ProductID) { bool result = false; try { var config = new MapperConfiguration( cfg => { cfg.CreateMap <RequestTrans15, ModuleAvailabilitySearch>(); } ); var transA1 = config.CreateMapper().Map <ModuleAvailabilitySearch>(Request); transA1.SecurityCode = securityCode; transA1.SubscriberCode = subNo; destination = environment == "Test" ? Destination.Test : Destination.Live; var response = await client.ProcessRequestTransA1Async(transA1, destination); if (!result) { log.LogError(UserID.ToString(), "DataSolution.Services", "ProcessTrasactionA1", response.ErrorCode + ":" + response.ErrorMessage); } //log transaction endDate = DateTime.Now; transData = new TransactionModel.TransactionData { EndDate = endDate, IsSuccessful = result, Message = response.ErrorMessage, ProductID = ProductID, StartDate = startDate, UserID = Convert.ToInt32(UserID) }; SaveTransaction(transData); } catch (Exception ex) { log.LogError(UserID.ToString(), "DataSolutions.Web", "TransUnionCommercialService.ProcessTrasaction01", ex.Message); } return(result); }
public async Task <bool> GetTickedtStatus(string TicketNo, int UserID, int ProductID) { bool result = false; try { var request = new MailboxTicketStatus { TicketNumber = TicketNo, SecurityCode = securityCode, SubscriberCode = subNo }; var response = await client.MailboxTicketStatusAsync(request); if (!result) { log.LogError(UserID.ToString(), "DataSolution.Services", "GetTickedtStatus", response.ErrorCode + ":" + response.ErrorMessage); } //log transaction endDate = DateTime.Now; transData = new TransactionModel.TransactionData { EndDate = endDate, IsSuccessful = result, Message = response.ErrorMessage, ProductID = ProductID, StartDate = startDate, UserID = Convert.ToInt32(UserID) }; SaveTransaction(transData); } catch (Exception ex) { log.LogError(UserID.ToString(), "DataSolutions.Web", "TransUnionCommercialService.GetTickedtStatus", ex.Message); } return(result); }
public async Task <bool> BMSRetrieveAlert(BMSAlertsRetrieveRequest Request, int UserID, int ProductID) { startDate = DateTime.Now; log = new Logger(); bool result = false; try { BMSAlert alert = (BMSAlert)Enum.Parse(typeof(BMSAlert), Request.alertType, true); var response = await client.BMSAlertsRetrieveAsync(subNo, securityCode, Request.startDate, Request.endDate, alert); endDate = DateTime.Now; result = response.ErrorMessage.Count() < 1 ? true : false; if (!result) { log.LogError(UserID.ToString(), "DataSolution.Services", "BMSRetrieveAlert", response.ErrorMessage); } //log transaction endDate = DateTime.Now; transData = new TransactionModel.TransactionData { EndDate = endDate, IsSuccessful = result, Message = response.ErrorMessage, ProductID = ProductID, StartDate = startDate, UserID = Convert.ToInt32(UserID) }; SaveTransaction(transData); } catch (Exception ex) { log.LogError(UserID.ToString(), "DataSolutions.Web", "TransUnionCommercialService.BMSRetrieveAlert", ex.Message); } return(result); }
private bool SaveTransaction(TransactionModel.TransactionData Transaction) { return(new TransactionData().InsertTransaction(Transaction, Transaction.UserID.ToString())); }
public async Task <bool> GetConsumerProfileWithAddress(TransunionRequest.BureauEnquiry37Request Request, string UserID, int ProductID) { startDate = DateTime.Now; log = new Logger(); try { var config = new MapperConfiguration( cfg => { cfg.CreateMap <BureauEnquiry37Request, BureauEnquiry37>() .ForMember(x => x.NoOfDependants, y => y.MapFrom(z => z.Dependents)) .ForMember(x => x.ProvinceCode, y => y.MapFrom(z => z.Province)) .ForMember(x => x.Address1Period, y => y.MapFrom(z => z.AddressPeriod)) .ForMember(x => x.BankAccountNumber, y => y.MapFrom(z => z.BankNo)) .ForMember(x => x.EmailAddress, y => y.MapFrom(z => z.Email)); } ); var mapper = config.CreateMapper(); var bureauEnquiry37 = mapper.Map <BureauEnquiry37>(Request); bureauEnquiry37.SecurityCode = securityCode; bureauEnquiry37.SubscriberCode = subNo; bureauEnquiry37.EnquirerContactName = "Prelen Nair"; bureauEnquiry37.EnquirerContactPhoneNo = "083225398"; destination = environment == "Test" ? Destination.Test : Destination.Live; /* Begin Proxy code*/ //BasicHttpBinding binding = new BasicHttpBinding("ConsumerSoap"); //binding.Security.Mode = BasicHttpSecurityMode.Transport; //binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Basic; //binding.UseDefaultWebProxy = false; //binding.ProxyAddress = new Uri("http://proxy.ntcweb.co.za:8080"); //EndpointAddress endpoint = new EndpointAddress("https://securetest.transunion.co.za/TUBureau118/Consumer.asmx"); //ConsumerSoapClient soap = new ConsumerSoapClient(binding, endpoint); //soap.ClientCredentials.UserName.UserName = "******"; //soap.ClientCredentials.UserName.Password = "******"; //var response = await client.ProcessRequestTrans37Async(bureauEnquiry37, destination); /*End Proxy Code*/ var response = await client.ProcessRequestTrans37Async(bureauEnquiry37, destination); result = response.ErrorCode.Trim() == string.Empty ? true : false; endDate = DateTime.Now; if (!result) { log.LogError(UserID, "DataSolutions.Services", "TransunionAPIController,ProcessRequestTrans37Async", response.ErrorCode + " " + response.ErrorMessage); } //Save the transaction transData = new TransactionModel.TransactionData { EndDate = endDate, IsSuccessful = result, Message = response.ErrorMessage, ProductID = ProductID, StartDate = startDate, UserID = Convert.ToInt32(UserID) }; SaveTransaction(transData); } catch (Exception ex) { log.LogError(UserID, "DataSolutions.Services", "TransunionAPIController.ProcessRequestTrans37Async", ex.Message); } return(result); }
public async Task <bool> IndividualTraceSearchAsync(TransunionRequest.IndividualTraceSearchRequest Request, string UserID, int ProductID) { startDate = DateTime.Now; log = new Logger(); try { var config = new MapperConfiguration( cfg => { cfg.CreateMap <IndividualTraceSearchRequest, IndividualTraceSearchInput>() .ForMember(x => x.TicketNumber, y => y.MapFrom(z => z.TicketNo)) .ForMember(x => x.ReportNumber, y => y.MapFrom(z => z.ReportNo)) .ForMember(x => x.UserEmail, y => y.MapFrom(z => z.Email)) .ForMember(x => x.ConsumerNumber, y => y.MapFrom(z => z.ConsumerNo)) .ForMember(x => x.TelephoneAreaCode, y => y.MapFrom(z => z.PhoneCode)) .ForMember(x => x.TelephoneNumber, y => y.MapFrom(z => z.TelNo)) .ForMember(x => x.CellNumber, y => y.MapFrom(z => z.CellNo)) .ForMember(x => x.AddressStreetNumber, y => y.MapFrom(z => z.StreetAddress)) .ForMember(x => x.AddressSuburb, y => y.MapFrom(z => z.Suburb)) .ForMember(x => x.AddressTown, y => y.MapFrom(z => z.Town)) .ForMember(x => x.AddressPostalCode, y => y.MapFrom(z => z.PostalCode)) .ForMember(x => x.IdentityNumber, y => y.MapFrom(z => z.IDNo)) .ForMember(x => x.DateOfBirth, y => y.MapFrom(z => z.DateOfBirth));; } ); var mapper = config.CreateMapper(); var individualTrace = mapper.Map <IndividualTraceSearchInput>(Request); individualTrace.SubscriberCode = subNo; individualTrace.SecurityCode = securityCode; individualTrace.SearchType = "01"; individualTrace.SearchReason = "61"; /* Begin Proxy code*/ //BasicHttpBinding binding = new BasicHttpBinding("ConsumerSoap"); //binding.Security.Mode = BasicHttpSecurityMode.Transport; //binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Basic; //binding.UseDefaultWebProxy = false; //binding.ProxyAddress = new Uri("http://proxy.ntcweb.co.za:8080"); //EndpointAddress endpoint = new EndpointAddress("https://securetest.transunion.co.za/TUBureau118/Consumer.asmx"); //ConsumerSoapClient soap = new ConsumerSoapClient(binding, endpoint); //soap.ClientCredentials.UserName.UserName = "******"; //soap.ClientCredentials.UserName.Password = "******"; //var response = await soap.ProcessRequestIndividualTraceSearchInputAsync(individualTrace); /*End Proxy Code*/ var response = await client.ProcessRequestIndividualTraceSearchInputAsync(individualTrace); result = response.ErrorCode == null ? true : false; if (result) { string ticketno = string.Empty; string consumerno = string.Empty; if (response.TraceInformationTI != null) { ticketno = response.TraceInformationTI[0].OTicketNumber; } if (response.TraceDetailsTD != null) { consumerno = response.TraceDetailsTD[0].OConsumerNumber; } TransunionRequest.TraceOrder68Request trace68 = new TraceOrder68Request { TicketNo = ticketno, ConsumerNo = consumerno, IDNo1 = individualTrace.IdentityNumber, AddressLine1 = individualTrace.AddressLine1, AddressLine2 = individualTrace.AddressLine2, Suburb = individualTrace.AddressSuburb, CellNo = Request.CellNo }; var products = await PersonalTraceOrder(trace68, UserID, ProductID); } else { log.LogError(UserID, "DataSolutions.Services", "TransunionAPIController.IndividualTraceSearchAsync", response.ErrorCode + " " + response.ErrorMessage); } //Save Transaction endDate = DateTime.Now; transData = new TransactionModel.TransactionData { EndDate = endDate, IsSuccessful = result, Message = response.ErrorMessage, ProductID = ProductID, StartDate = startDate, UserID = Convert.ToInt32(UserID) }; SaveTransaction(transData); result = true; } catch (Exception ex) { log.LogError(UserID, "DataSolutions.Services", "TransunionAPIController,IndividualTraceSearchAsync", ex.Message); } return(result); }
public async Task <bool> ProcessRequestTrans41Async(TransunionRequest.RequestTrans01 Request, string UserID, int ProductID) { startDate = DateTime.Now; log = new Logger(); try { var config = new MapperConfiguration( cfg => { cfg.CreateMap <RequestTrans01, BureauEnquiry41>() .ForMember(x => x.ul_long_score, y => y.MapFrom(z => z.LongScore)) .ForMember(x => x.ul_medium_score, y => y.MapFrom(z => z.MediumScore)) .ForMember(x => x.ul_short_score, y => y.MapFrom(z => z.ShortScore)) .ForMember(x => x.ul_average_score, y => y.MapFrom(z => z.AverageScore)); } ); var mapper = config.CreateMapper(); var enquiry41 = mapper.Map <BureauEnquiry41>(Request); enquiry41.SecurityCode = securityCode; enquiry41.SubscriberCode = subNo; enquiry41.EnquirerContactName = "Prelen Nair"; enquiry41.EnquirerContactPhoneNo = "0832253698"; destination = environment == "Test" ? Destination.Test : Destination.Live; /* Begin Proxy code*/ //BasicHttpBinding binding = new BasicHttpBinding("ConsumerSoap"); //binding.Security.Mode = BasicHttpSecurityMode.Transport; //binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Basic; //binding.UseDefaultWebProxy = false; //binding.ProxyAddress = new Uri("http://proxy.ntcweb.co.za:8080"); //EndpointAddress endpoint = new EndpointAddress("https://securetest.transunion.co.za/TUBureau118/Consumer.asmx"); //ConsumerSoapClient soap = new ConsumerSoapClient(binding, endpoint); //soap.ClientCredentials.UserName.UserName = "******"; //soap.ClientCredentials.UserName.Password = "******"; //var response = await soap.ProcessRequestTrans41Async(enquiry41, destination); /*End Proxy Code*/ var response = await client.ProcessRequestTrans41Async(enquiry41, destination); result = response.ErrorCode == null ? true : false; if (result) { string ticketno = ""; if (response.TicketSuccessConfirmationFR != null) { ticketno = response.TicketSuccessConfirmationFR.TicketNumber; } if (response.TraceInformationTI != null) { ticketno = response.TraceInformationTI[0].OTicketNumber; } bool x = await new TransUnionPDFService().ConvertPDFAsync("Prelen", "*****@*****.**", ticketno, UserID); string str = await new TransUnionPDFService().GetReportLink(UserID, subNo, securityCode, ticketno); } else { log.LogError(UserID, "DataSolutions.Services", "TransunionAPIController.ProcessRequestTrans41Async", response.ErrorCode + " " + response.ErrorMessage); } // Save Transaction endDate = DateTime.Now; transData = new TransactionModel.TransactionData { EndDate = endDate, IsSuccessful = result, Message = response.ErrorMessage, ProductID = ProductID, StartDate = startDate, UserID = Convert.ToInt32(UserID) }; SaveTransaction(transData); } catch (Exception ex) { log.LogError(UserID, "DataSolutions.Services", "TransunionAPIController.ProcessRequestTrans41Async", ex.Message); } return(result); }
public async Task <bool> PersonalTraceOrder(TransunionRequest.TraceOrder68Request Request, string UserID, int ProductID) { startDate = DateTime.Now; log = new Logger(); if (Request.ProductCode != null) { ModuleProductCode code = new ModuleProductCode(); int count = Request.ProductCode != null ? Request.ProductCode.Count : 0; ModuleProductCode[] productCode = new ModuleProductCode[count]; int i = 0; foreach (string item in Request.ProductCode) { code.Code = item; productCode[i] = code; code = new ModuleProductCode(); } } try { var config = new MapperConfiguration( cfg => { cfg.CreateMap <TraceOrder68Request, IndividualTraceProductOrder68>() .ForMember(x => x.ConsumerNumber, y => y.MapFrom(z => z.ConsumerNo)) .ForMember(x => x.TelephoneCode1, y => y.MapFrom(z => z.TelCode1)) .ForMember(x => x.TelephoneCode2, y => y.MapFrom(z => z.TelCode2)) .ForMember(x => x.PostalCode, y => y.MapFrom(z => z.Code)); } ); var mapper = config.CreateMapper(); var trace = mapper.Map <IndividualTraceProductOrder68>(Request); trace.SecurityCode = securityCode; trace.SubscriberCode = subNo; var products = new List <ModuleProductCode>(); var module = new ModuleProductCode(); module.Code = "6502"; products.Add(module); module = new ModuleProductCode(); module.Code = "6503"; products.Add(module); module = new ModuleProductCode(); module.Code = "6504"; products.Add(module); module = new ModuleProductCode(); module.Code = "6505"; products.Add(module); trace.ModuleProducts = products.ToArray(); /* Begin Proxy code*/ //BasicHttpBinding binding = new BasicHttpBinding("ConsumerSoap"); //binding.Security.Mode = BasicHttpSecurityMode.Transport; //binding.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.Basic; //binding.UseDefaultWebProxy = false; //binding.ProxyAddress = new Uri("http://proxy.ntcweb.co.za:8080"); //EndpointAddress endpoint = new EndpointAddress("https://securetest.transunion.co.za/TUBureau118/Consumer.asmx"); //ConsumerSoapClient soap = new ConsumerSoapClient(binding, endpoint); //soap.ClientCredentials.UserName.UserName = "******"; //soap.ClientCredentials.UserName.Password = "******"; //var response = await soap.ProcessRequestIndividualTraceProductOrderTrans05Async(trace); /*End Proxy Code*/ var response = await client.ProcessRequestIndividualTraceProductOrderTrans05Async(trace); result = response.ErrorCode == null ? true : false; if (result) { string str = await new TransUnionPDFService().GetReportLink(UserID, subNo, securityCode, Request.TicketNo); bool x = await new TransUnionPDFService().ConvertPDFAsync("Prelen", "*****@*****.**", Request.TicketNo, UserID); } else { log.LogError(UserID, "DataSolutions.Services", "TransunionAPIController.TraceOrder68Async", response.ErrorCode + " " + response.ErrorMessage); } //Save Transaction endDate = DateTime.Now; transData = new TransactionModel.TransactionData { EndDate = endDate, IsSuccessful = result, Message = response.ErrorMessage, ProductID = ProductID, StartDate = startDate, UserID = Convert.ToInt32(UserID) }; SaveTransaction(transData); } catch (Exception ex) { log.LogError(UserID, "DataSolutions.Services", "TransunionAPIController.TraceOrder68Async", ex.Message); } return(result); }