Пример #1
0
 /// <summary>
 /// 重置商城信息
 /// </summary>
 public static void ResetShop()
 {
     lock (_locker)
     {
         _shopconfiginfo = BSPConfig.ShopConfig;
     }
 }
Пример #2
0
        private static SMSConfigInfo _smsconfiginfo = null; //短信配置

        #endregion Fields

        #region Constructors

        static SMSes()
        {
            _ismsstrategy = BSPSMS.Instance;
            _smsconfiginfo = BSPConfig.SMSConfig;
            _shopconfiginfo = BSPConfig.ShopConfig;
            _ismsstrategy.Url = _smsconfiginfo.Url;
            _ismsstrategy.UserName = _smsconfiginfo.UserName;
            _ismsstrategy.Password = _smsconfiginfo.Password;
        }
Пример #3
0
 /// <summary>
 /// 保存商城配置信息
 /// </summary>
 public static void SaveShopConfig(ShopConfigInfo shopConfigInfo)
 {
     lock (_locker)
     {
         if (_iconfigstrategy.SaveShopConfig(shopConfigInfo))
         {
             _shopconfiginfo = shopConfigInfo;
         }
     }
 }
Пример #4
0
        private static ShopConfigInfo _shopconfiginfo = null; //商城配置信息

        #endregion Fields

        #region Constructors

        /// <summary>
        /// 静态构造函数
        /// </summary>
        static Emails()
        {
            _iemailstrategy = BSPEmail.Instance;
            _emailconfiginfo = BSPConfig.EmailConfig;
            _shopconfiginfo = BSPConfig.ShopConfig;
            _iemailstrategy.Host = _emailconfiginfo.Host;
            _iemailstrategy.Port = _emailconfiginfo.Port;
            _iemailstrategy.UserName = _emailconfiginfo.UserName;
            _iemailstrategy.Password = _emailconfiginfo.Password;
            _iemailstrategy.From = _emailconfiginfo.From;
            _iemailstrategy.FromName = _emailconfiginfo.FromName;
        }
Пример #5
0
        private static RabbitMQOrderConfigInfo _rabbitmqorderconfiginfo       = null; //RabbitMQ订单配置信息

        static BSPConfig()
        {
            try
            {
                string[] fileNameList = Directory.GetFiles(System.Web.HttpRuntime.BinDirectory, "BrnShop.ConfigStrategy.*.dll", SearchOption.TopDirectoryOnly);
                _iconfigstrategy = (IConfigStrategy)Activator.CreateInstance(Type.GetType(string.Format("BrnShop.ConfigStrategy.{0}.ConfigStrategy, BrnShop.ConfigStrategy.{0}", fileNameList[0].Substring(fileNameList[0].LastIndexOf("ConfigStrategy.") + 15).Replace(".dll", "")),
                                                                                          false,
                                                                                          true));
            }
            catch
            {
                throw new BSPException("创建'配置策略对象'失败,可能存在的原因:未将'配置策略程序集'添加到bin目录中;'配置策略程序集'文件名不符合'BrnShop.ConfigStrategy.{策略名称}.dll'格式");
            }
            _rdbsconfiginfo = _iconfigstrategy.GetRDBSConfig();
            _shopconfiginfo = _iconfigstrategy.GetShopConfig();
        }
Пример #6
0
        private static SMSConfigInfo _smsconfiginfo = null; //短信配置信息

        #endregion Fields

        #region Constructors

        static BSPConfig()
        {
            try
            {
                string[] fileNameList = Directory.GetFiles(System.Web.HttpRuntime.BinDirectory, "BrnShop.ConfigStrategy.*.dll", SearchOption.TopDirectoryOnly);
                _iconfigstrategy = (IConfigStrategy)Activator.CreateInstance(Type.GetType(string.Format("BrnShop.ConfigStrategy.{0}.ConfigStrategy, BrnShop.ConfigStrategy.{0}", fileNameList[0].Substring(fileNameList[0].LastIndexOf("ConfigStrategy.") + 15).Replace(".dll", "")),
                                                                                         false,
                                                                                         true));
            }
            catch
            {
                throw new BSPException("创建'配置策略对象'失败,可能存在的原因:未将'配置策略程序集'添加到bin目录中;'配置策略程序集'文件名不符合'BrnShop.ConfigStrategy.{策略名称}.dll'格式");
            }
            _rdbsconfiginfo = _iconfigstrategy.GetRDBSConfig();
            _shopconfiginfo = _iconfigstrategy.GetShopConfig();
        }
Пример #7
0
 /// <summary>
 /// 保存商城基本配置
 /// </summary>
 /// <param name="configInfo">商城基本配置信息</param>
 /// <returns>是否保存结果</returns>
 public bool SaveShopConfig(ShopConfigInfo configInfo)
 {
     return SaveConfigInfo(configInfo, IOHelper.GetMapPath(_shopconfigfilepath));
 }
Пример #8
0
 /// <summary>
 /// 保存商城配置信息
 /// </summary>
 public static void SaveShopConfig(ShopConfigInfo shopConfigInfo)
 {
     lock (_locker)
     {
         if (_iconfigstrategy.SaveShopConfig(shopConfigInfo))
             _shopconfiginfo = shopConfigInfo;
     }
 }