コード例 #1
0
ファイル: TradeController.cs プロジェクト: Oldsooh/SHTS
        public ActionResult Config()
        {
            PublicConfigModel model = new PublicConfigModel();
            PublicConfig tradeReminding = null;
            PublicConfig payCommissionPercent = null;
            PublicConfig minPayCommission = null;
            try
            {
                tradeReminding = publicConfigManager.GetConfigValue("TradeReminding");
                payCommissionPercent = publicConfigManager.GetConfigValue("PayCommissionPercent");
                minPayCommission = publicConfigManager.GetConfigValue("MinPayCommission");
            }
            catch (Exception e)
            {
                LogService.Log("获取中介参数失败", e.ToString());
            }

            model.MultipleConfigs.Add("TradeReminding", tradeReminding ?? new PublicConfig());
            model.MultipleConfigs.Add("PayCommissionPercent", payCommissionPercent ?? new PublicConfig());
            model.MultipleConfigs.Add("MinPayCommission", minPayCommission ?? new PublicConfig());

            return View(model);
        }
コード例 #2
0
ファイル: TradeController.cs プロジェクト: Oldsooh/SHTS
        public ActionResult BankConfig()
        {
            PublicConfigModel model = new PublicConfigModel();
            try
            {
                List<PublicConfig> configs = publicConfigManager.GetConfigValues(Constant.TradeBankInfoConfig);

                if (configs != null && configs.Count > 0)
                {
                    for (int i = 0; i < configs.Count; i++)
                    {
                        var config = configs[i];
                        if (config != null)
                        {
                            model.MultipleConfigs.Add(config.ConfigName + i, config);
                        }
                    }
                }
            }
            catch (Exception e)
            {
                LogService.Log("获取线下支付银行帐号信息失败", e.ToString());
            }

            return View(model);
        }
コード例 #3
0
ファイル: TradeController.cs プロジェクト: Oldsooh/SHTS
        /// <summary>
        /// New a third-part trade
        /// </summary>
        /// <returns></returns>
        public ActionResult New()
        {
            if (!IsUserLogin)
            {
                return Redirect("/account/login");
            }

            PublicConfigModel configModel = new PublicConfigModel();
            TradeModel model = new TradeModel();

            configModel.MultipleConfigs.Add("TradeReminding", configService.GetConfigValue("TradeReminding") ?? new PublicConfig());
            configModel.MultipleConfigs.Add("PayCommissionPercent", configService.GetConfigValue("PayCommissionPercent") ?? new PublicConfig());
            configModel.MultipleConfigs.Add("MinPayCommission", configService.GetConfigValue("MinPayCommission") ?? new PublicConfig());
            model.TradeConfig = configModel;
            model.CurrentUser = UserInfo ?? new User();
            model.BankInfos = (UserInfo == null ? new List<UserBankInfo>() : userService.GetUserBankInfos(UserInfo.UserId));

            if (model.BankInfos != null && model.BankInfos.Count > 0)
            {
                var bankInfo = model.BankInfos.FirstOrDefault(c => c.IsDefault);
                if (bankInfo == null)
                {
                    model.BankInfos[0].IsDefault = true;
                }
            }

            return View(model);
        }