Exemplo n.º 1
0
        /// <summary>
        /// 创建品种管理类。
        /// </summary>
        private void CreateProductManager()
        {
            string dbConnStr = ConfigurationManager.ConnectionStrings["KLineDB"].ConnectionString;

            if (string.IsNullOrEmpty(dbConnStr))
            {
                throw new ArgumentException("Not found KLineDB ConnectionString");
            }
            string alpahDBName = ConfigurationManager.AppSettings["AlphaDBName"];

            if (string.IsNullOrEmpty(alpahDBName))
            {
                throw new ArgumentException("Not foun AlphaDBName config");
            }

            try
            {
                USeProductManager manager = new USeProductManager(dbConnStr, alpahDBName);
                manager.Initialize();

                m_productManager = manager;

                string text = String.Format("{0} Create {1} OK.", this, manager);
                m_eventLogger.WriteInformation(text);
            }
            catch (Exception ex)
            {
                string text = "Create ProductManager object failed, " + ex.Message;
                throw new ApplicationException(text, ex);
            }
        }
Exemplo n.º 2
0
        protected USeProductManager CreateVarietiesManager()
        {
            USeProductManager manager = new USeProductManager(m_dbConStr, m_alphaDBName);

            manager.Initialize();

            return(manager);
        }