Click here to Skip to main content
15,880,796 members
Articles / Programming Languages / C#

DnB Risk Analysis

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
5 Aug 2013CPOL2 min read 9.6K   2   1
Analyzing the risk associated with owning, investing, or collaborating with business by utilizing DnB Marketplace data subset.

This article is an entry in our DnB Developer Challenge. Articles in this sub-section are not required to be full articles so care should be taken when voting.

Introduction

Change is inevitable, and so is the ever growing market with variety of businesses. Thus analyzing company in a bid to understand current market trends, unforeseen incidents or penalties is essential in the road-map of business success.

As DnB has very latest information on the bankruptcy, lien, and judgment, debarment, out of business indicator, Annual Sales, Environmental Hazard Risk areas, green-certified indicator and Net Worth of businesses around the world. All this factors are updated quite frequently and give a valuable insight of the performance, future prospect, and code of conduct of a business.

The application, that I am proposing, is a tool that could be utilized to fetch these various factors of a business based on Company’s name or DUNS number, and list out other companies with same line of business.

Link to Web application:  http://dnbriskanalysis.cloudapp.net/  

Mission  

This application has twofold mission. The first objective being achieved here is to retrieve the risk determining factors like bankruptcy, lien, judgment, debarment, out of business indicator, Annual Sales, Environmental Hazard Risk areas, green-certified indicator and Net Worth of business for given Company’s name or DUNS number.

Second objective is to lay down the equivalent businesses with much better performance, future prospect. This is achieved by calculating the Risk Factor,

Results would be posted on the Google Maps. This would ease users to compare various factors of business in near proximity.

Target Audience

  1. Suppliers it has been always concern of supplier to find the credit worthiness of buyers and find the new businesses that have same supply needs.
  2. Buyers can obtain the goods from a business based on evaluation of various risk factors fetched.
  3. Investors may observe various risk factors of business before allocating billions dollar amount into equities, securities, or bonds of a business.
  4. Loan Lenders based on debarment, out of business indicator, Annual Sales and Net Worth determines LGD (loss given default) and PD (Probability of default) to allocate Loan amount.

Using the Code

  1. Create a method to initialize the connection to DNBDeveloperSandboxContainer.
    C#
    DNBDeveloperSandboxContainer clntDnN = new DNBDeveloperSandboxContainer(
              new Uri("https://api.datamarket.azure.com/DNB/DeveloperSandbox/v1"));
    public void fnInitializeDnNSandboxData()
    {
        string AccountKey = "YourKey"
        clntDnN.Credentials = new System.Net.NetworkCredential(AccountKey,AccountKey );
        List<string > lstDUNSNo = getDUNSNo();
        getCompanydata(lstDUNSNo);
    }
  2. Create a function to fetch data from Windows Azure Marketplace, this function would create task for each entity that we are interested in and would execute all of them parallely.
    C#
    public void getCompanydata(List<string> strDUNSNo)
    {
        {
            tskGetLatLong = Task<List<LocationLatLong>>.Factory.StartNew(() => getLocationLatLongdata(strDUNSNo));
            tskGetFamilyData = Task<List<FamilyHierarchy>>.Factory.StartNew(() => getFamilyHierarchydata(strDUNSNo));
            tskGetFirmograpgyData = Task<List<Firmographics>>.Factory.StartNew(() => getFirmographicsdata(strDUNSNo));
            tskGetDemographicsData = Task<List<Demographics>>.Factory.StartNew(() => getDemographicsdata(strDUNSNo));
            tskGetPublicRecordsData = Task<List<PublicRecords>>.Factory.StartNew(() => getPublicRecordsdata(strDUNSNo));
            tskGetGreenData = Task<List<Green>>.Factory.StartNew(() => getGreendata(strDUNSNo));
            tskGetMinorityData = Task<List<Minority>>.Factory.StartNew(() => getMinoritydata(strDUNSNo));
            tskGetWomenData = Task<List<Women>>.Factory.StartNew(() => getWomendata(strDUNSNo));
            tskGetVeteranData = Task<List<Veteran>>.Factory.StartNew(() => getVeterandata(strDUNSNo));
            tskGetDisadvantagedData = Task<List<Disadvantaged>>.Factory.StartNew(() => getDisadvantageddata(strDUNSNo));
            Task.WaitAll(tskGetFamilyData, tskGetFirmograpgyData, tskGetLatLong, tskGetPublicRecordsData, 
              tskGetVeteranData, tskGetWomenData, tskGetGreenData, tskGetDisadvantagedData, tskGetMinorityData);
        }
    }
  3. Use the jQuery AJAX calls to fetch the data from code behind and utilize those to display details in side bar on the click of markers on Google Maps.
    JavaScript
    function showDetails() {
        $(document).ready(function () {
            var valFromNameBox = $("#txtValueEntered").val();
            var jsonObj = '{strCompanyorDUNS: "' + valFromNameBox + '"}';
    
            if (geocoder) {
    
    
    
    
                $.ajax({
                    type: 'POST',
                    contentType: "application/json",
                    url: "DnBRiskAnalysis.aspx/MarkerData",
                    data: jsonObj,
                    dataType: "json",
                    success: function (data) {
    
                         $(data.d).each(function (index, item) {
                          var data = item.split(",");
    
    
                          var marker = new GMarker(new GLatLng(data[1], data[2]));
                          map.setCenter(new GLatLng(data[1], data[2]), 6);
                            GEvent.addListener(marker, "click", function () {
                                //alert('showed');
                                getBasicData(data[0]);
                                getAdvancedData(data[0]);
                                $('#dynamicTable').show();
    
                            });
    
                            map.addOverlay(marker);
    
                        })
                    },
                    error: function (xhr, ajaxOptions, thrownError) {
                        alert(xhr.status);
                        alert(xhr.responseText);
                        alert(thrownError);
                    }
    
                });
    
            }
        });
    };
    
    function getBasicData(valFromNameBox) {
                $(document).ready(function () {
    
                   // var valFromNameBox = $("#txtValueEntered").val();
                    var jsonObj = '{strCompanyorDUNS: "' + valFromNameBox + '"}';
                    $.ajax({
                        type: 'POST',
                        contentType: "application/json",
                        url: "DnBRiskAnalysis.aspx/DisplayBasicDetails",
                        data:jsonObj,
                        dataType: "json",
                        success: function (data) {
                            var div = $('#dynamicTable');
    
                            var i = 1;
                            //var tde = $('#basicdata tr:nth-child(2) td:last');
                            //alert(tde.val());
                            //alert(tde.text());
                            //alert(tde.html());
                            //var index = tde.index('td');
    
                            //alert(index);
                                $(data.d).each(function (index, item) {
                                    i++;
                                    if (item == null)
                                        item = 'NA';
                                    $(div).find('#basicdata tr:nth-child(' + i + ') td:eq(1)').remove();
                                    $(div).find('#basicdata tr:nth-child(' + i + ') td:last').after('<td>' + item + '</td>');
    
                                });
    
    
                        },
    
                        error: function (xhr, ajaxOptions, thrownError) {
                            alert(xhr.status);
                            alert(xhr.responseText);
                            alert(thrownError);
                        }
    
                    });
    
                })
            };
    
    function getAdvancedData(valFromNameBox) {
                $(document).ready(function () {
    
                   // var valFromNameBox = $("#txtValueEntered").val();
                    var jsonObj = '{strCompanyorDUNS: "' + valFromNameBox + '"}';
    
                    $.ajax({
                        type: 'POST',
                        contentType: "application/json",
                        url: "DnBRiskAnalysis.aspx/AdvancedDetailsData",
                        data: jsonObj,
                        dataType: "json",
                        success: function (data) {
                            var div = $('#dynamicTable');
                            var i = 1;
    
                            if (div.find('#basicdata tr:nth-child(2) td:last').index != 2) {
                                $(data.d).each(function (index, item) {
    
                                    if (item == null)
                                        item = 'NA';
                                    i++;
                                    $(div).find('#advanceddata tr:nth-child(' + i + ') td:eq(1)').remove();
                                    $(div).find('#advanceddata tr:nth-child(' + i + ') td:last').after('<td>' + item + '</td>');
    
                                });
                            }
    
                        },
                        error: function (xhr, ajaxOptions, thrownError) {
                            alert(xhr.status);
                            alert(xhr.responseText);
                            alert(thrownError);
                        }
    
                    });
    
                })
            };
    

UI Snapshots

1. Enter company name or DUNS no, and click search image.<o:p>

 <o:p>  

2. Check the compare check box, and hit search button to display the same businesses in near proximity.  

3. Click on the Marker to get basic and advanced details of the company.

 

Background 

The importance of risk assessment should not be undervalued. It’s the risk estimation that eases the decision making, and saving a business from a disaster. Risk assessment should be the part of every organization’s strategic plan.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
Software developer, who has great zeal for learning new technologies, and is in search of more fulfilling status quo.

Professional summary;

• 6 years 10 months of cognitive learning experience in designing, developing, testing and maintenance of web applications using Microsoft .Net technologies.
• Conversant in of all phases of software development life software development process.
• Worked on VB.Net, C#.Net, .Net Framework 3.5/4.5, TPL, Unit testing, Integration testing, Reporting tool, Visual Source Safe, Visual Studio 2005/2008/2012, ADO.NET, ASP.NET, AJAX, LINQ, SQL server 2005, Jquery, SSIS, SSRS, TOAD, Moody’s Risk Analyst tool, Excel Macros, Microsoft Access, QTP.
• Possess strong analytical and problem solving skills, with the ability to make decisions after intensive analysis of requirements.
• Possess knowledge in Testing Automation using QTP.
• Knowledge on the basics of MapReduce, Natural language processing.
• Researched on the "AdRelevance using MapReduce" to propose a novel approach that utilizes the SERP keywords as a look up for the sponsored ads retrieval on search engine results page.

In her work tenure, she has received “Kudos award” for providing outstanding services and support beyond the call of duty and “Star award” for exceptional mentoring and counseling and grooming resources and contributing to team building

She has been winner for 3 data spot challenges arranged by DnB.

Comments and Discussions

 
QuestionThanks for your submission! Pin
Kevin Priddle25-Jul-13 6:51
professionalKevin Priddle25-Jul-13 6:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.