Пример #1
0
 public HttpResponseMessage CompleteTask([FromBody]RetrieveMerchantInformation model, Int64 tasktypeid, Int64 merchantId, Int64 contractId, int iscompleted, int workflowid)
 {
     using (CreditReportTier mt = new CreditReportTier())
     {
         if (mt.CompleteTask(model, tasktypeid, merchantId, contractId, iscompleted, workflowid, model.rawData, string.Empty))
         {
             return this.Request.CreateResponse(HttpStatusCode.OK);
         }
         else
         {
             return this.Request.CreateResponse(HttpStatusCode.BadRequest);
         }
     }
 }
Пример #2
0
        public HttpResponseMessage RetrieveMerchantScore(Int64 merchantId, Int64 contractId, Int32 workflowid, Int32 tasktypeid)
        {
            DataSet ds;
            using (CreditReportTier mt = new CreditReportTier())
            {
                ds = (mt.RetrieveInformationforScorin(merchantId));
                DataTable MerchantInfo = ds.Tables[0];
                MerchantInfo.TableName = "MerchantInfo";
                DataTable OwnerInfo = ds.Tables[1];
                OwnerInfo.TableName = "Owners";
                DataTable Processor = ds.Tables[2];
                Processor.TableName = "Processor";
                DataTable OwnerCreditInfo = ds.Tables[3];
                OwnerCreditInfo.TableName = "OwnerCreditInfo";
                DataTable OwnerLoans = ds.Tables[4];
                OwnerLoans.TableName = "OwnerLoans";
                DataTable OwnerCreditCard = ds.Tables[5];
                OwnerCreditCard.TableName = "CreditCard";
                DataTable OwnerOthers = ds.Tables[6];
                OwnerOthers.TableName = "Other";
                DataTable BankStatements = ds.Tables[11];
                BankStatements.TableName = "BankStatements";

                DataTable CompanyCreditInfo = ds.Tables[7];
                CompanyCreditInfo.TableName = "CompanyCreditInfo";
                DataTable CompanyLoans = ds.Tables[8];
                CompanyLoans.TableName = "CompanyLoans";
                DataTable CompanyCreditCard = ds.Tables[9];
                CompanyCreditCard.TableName = "CompanyCreditCard";
                DataTable CompanyOthers = ds.Tables[10];
                CompanyOthers.TableName = "CompanyOthers";
                DataTable CCActvity = ds.Tables[12];
                CCActvity.TableName = "CreditCardActivity";

                DataTable CCVolumes = ds.Tables[13];
                CCVolumes.TableName = "CCACCVTotalAmount";
                //GenXML(ds);
                XmlDocument doc = new XmlDocument();
                string requestxml = mt.CreateXML(ds);
                doc.LoadXml(requestxml);
                XmlElement root = doc.DocumentElement;

                //Call the service to fetch the report
                DataviewService.DataviewServiceSoapClient clinet = new DataviewService.DataviewServiceSoapClient();
                var report = clinet.ProcessApplicationXML(root);
                var sr = JsonConvert.SerializeObject(report, Newtonsoft.Json.Formatting.Indented);
                JObject obj = JObject.Parse(sr);

                string Score = obj.SelectToken("Response").SelectToken("Score").ToString();
                string Roundedscore = obj.SelectToken("Response").SelectToken("ScoreRedondeado").ToString();
                string Finalletter = obj.SelectToken("Response").SelectToken("LetraFinal").ToString();

                if (mt.CompleteTask(Convert.ToDouble(Score), Convert.ToDouble(Score), Finalletter, tasktypeid, merchantId, contractId, 0, workflowid, sr, requestxml))
                {
                    return this.Request.CreateResponse(HttpStatusCode.OK, mt.RetrieveMerchantInformation(merchantId, contractId));
                }
                else
                {
                    return this.Request.CreateResponse(HttpStatusCode.BadRequest, mt.RetrieveMerchantInformation(merchantId, contractId));
                }
            }
        }