public JsonResult SaveConfigTable(string serializedModels, string configTableType)
        {
            ConfigTableType c;

            switch (configTableType)
            {
            case "LoanOfferMultiplier":
                c = ConfigTableType.LoanOfferMultiplier;
                break;

            case "EuLoanMonthlyInterest":
                c = ConfigTableType.EuLoanMonthlyInterest;
                break;

            case "DefaultRateCompany":
                c = ConfigTableType.DefaultRateCompany;
                break;

            case "DefaultRateCustomer":
                c = ConfigTableType.DefaultRateCustomer;
                break;

            default:
                c = ConfigTableType.BasicInterestRate;
                break;
            }
            var deserializedModels = JsonConvert.DeserializeObject <List <ConfigTable> >(serializedModels);

            BoolActionResult result = this.serviceClient.Instance.SaveConfigTable(deserializedModels.ToArray(), c);

            return(Json(new { error = result.Value ? "Error occurred during save" : null }, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        }         // constructor

        public bool IsBroker(string sContactEmail)
        {
            BoolActionResult bar = null;

            CustomerOrigin uio = UiCustomerOrigin.Get();

            if (!string.IsNullOrWhiteSpace(sContactEmail))
            {
                try {
                    m_oLog.Debug(
                        "Checking whether '{0}' with origin '{1}' is a broker email.",
                        sContactEmail,
                        uio.Stringify()
                        );

                    bar = m_oServiceClient.Instance.IsBroker(sContactEmail, uio.CustomerOriginID);
                }
                catch (Exception e) {
                    m_oLog.Warn(
                        e,
                        "Failed to determine whether '{0}' with origin '{1}' is a broker email.",
                        sContactEmail,
                        uio.Stringify()
                        );
                }         // try
            }             // if

            var bIsBroker = (bar != null) && bar.Value;

            m_oLog.Debug(
                "'{0}' with origin '{2}' is {1}a broker email.",
                sContactEmail,
                bIsBroker ? "" : "not ",
                uio.Stringify()
                );

            return(bIsBroker);
        }         // IsBroker