public JsonResult DnBDirectLicense(CleanseMatchSettingsModel model, string btnSubmit = null)
        {
            SettingFacade             fac      = new SettingFacade(this.CurrentClient.ApplicationDBConnectionString);
            CleanseMatchSettingsModel oldmodel = new CleanseMatchSettingsModel();

            oldmodel.Settings = fac.GetCleanseMatchSettings();

            GetSettingIDs(oldmodel);
            try
            {
                model.Settings[oldmodel.DNB_PASSWORD].SettingValue = SBISCCMWeb.Utility.Utility.GetDecryptedString(model.Settings[model.DNB_PASSWORD].SettingValue);
            }
            catch
            {
                model.Settings[oldmodel.DNB_PASSWORD].SettingValue = model.Settings[oldmodel.DNB_PASSWORD].SettingValue;
            }
            oldmodel.Settings[oldmodel.DNB_USERNAME].SettingValue = model.Settings[oldmodel.DNB_USERNAME].SettingValue;
            oldmodel.Settings[oldmodel.DNB_PASSWORD].SettingValue = model.Settings[oldmodel.DNB_PASSWORD].SettingValue;
            oldmodel.Settings[oldmodel.API_LAYER].SettingValue    = ApiLayerType.Direct20.ToString();
            //check DnB Credentials is validate or not.
            string Message = fac.ValidateDnBLogin(oldmodel.Settings[oldmodel.DNB_USERNAME].SettingValue, oldmodel.Settings[oldmodel.DNB_PASSWORD].SettingValue);

            if (Message.ToLower() == MessageCollection.ValidCredential)
            {
                RestfulHttpClient <AuthResponse, string> authClient = new RestfulHttpClient <AuthResponse, string>(Helper.AuthURL, string.Empty, oldmodel.Settings[oldmodel.DNB_USERNAME].SettingValue, oldmodel.Settings[oldmodel.DNB_PASSWORD].SettingValue, Helper.JsonMediaType);
                var responseData = authClient.GetAuthResponse();
                if (responseData != null)
                {
                    if (responseData.TransactionResult.ResultID != "CM000")
                    {
                        Helper.ApiToken = null;
                    }
                    else
                    {
                        Helper.ApiToken = responseData.AuthenticationDetail.Token;
                    }
                }
                else
                {
                    Helper.ApiToken = null;
                }
                //update DnBDirectLicense Credentials
                fac.UpdateCleanseMatchSettings(oldmodel.Settings);
                fac.UpdateCleanseMatchSettingsAPIFamily(ApiLayerType.Direct20.ToString());
                Message = MessageCollection.SettingUpdate;
            }


            model.Settings = fac.GetCleanseMatchSettings();
            GetSettingIDs(model);
            SetMatchGradeContent(model);
            Clear(model);
            TempData["ApiLayer"] = ApiLayerType.Direct20.ToString();
            Helper.APILAYER      = ApiLayerType.Direct20.ToString();
            string Data = Message;

            return(Json(Data));
        }