Esempio n. 1
0
 public AbsPendingRecordProcess(StockDBContext stockdbContext) : base(stockdbContext)
 {
     this.pageInfo = new PageInfo()
     {
         PageIndex = 1,
         PageSize  = 500
     };
     this.needLoop = false;
 }
Esempio n. 2
0
        private static void InitializeDbContext(IConfiguration config, ILog log)
        {
            log.Info("Initialzie StockDBContext ....");
            DbContextOptions <StockDBContext>        dbContextOption        = new DbContextOptions <StockDBContext>();
            DbContextOptionsBuilder <StockDBContext> dbContextOptionBuilder = new DbContextOptionsBuilder <StockDBContext>(dbContextOption);
            StockDBContext stockDBContext = new StockDBContext(dbContextOptionBuilder.UseMySql(config.GetConnectionString("StockDBConnection")).Options);

            DataContextPool.AddDataContext(stockDBContext);
            log.Info("Initialize StockDBContext successfully and add it to Context Pool");
        }
Esempio n. 3
0
        public DownloadPerfProcessTest()
        {
            var    config     = new ConfigurationBuilder().Build();
            string connection = config.GetConnectionString("StockDBConnection");

            if (String.IsNullOrEmpty(connection))
            {
                connection = "server=localhost;port=3306;database=stock;uid=jeesite;pwd=123456;charset=utf8;TreatTinyAsBoolean=true";
            }
            this.dbContext = new StockDBContext(connection);
            DataContextPool.AddDataContext(dbContext);
        }
Esempio n. 4
0
        public void TestContext()
        {
            var    config     = new ConfigurationBuilder().Build();
            string connection = config.GetConnectionString("StockDBConnection");

            if (String.IsNullOrEmpty(connection))
            {
                connection = "server=localhost;port=3306;database=stock;uid=jeesite;pwd=123456;charset=utf8;TreatTinyAsBoolean=true";
            }
            StockDBContext sdb = new StockDBContext(connection);
            StockInfo      si  = sdb.StockInfos.Find("abc");

            if (si == null)
            {
                si = new StockInfo()
                {
                    Id        = "abc",
                    Name      = "abc",
                    BriefName = "abc",
                    Type      = StockType.Stock,
                    Symbol    = "abc",
                    Market    = "test",
                    Status    = StockStatus.Closed,
                };
                sdb.StockInfos.Add(si);
                sdb.SaveChanges();
            }
            si = sdb.StockInfos.Find("abc");
            Assert.NotNull(si);
            Assert.Equal("abc", si.Id);

            var stockInfo = sdb.StockInfos.Where(t => t.Id == si.Id).FirstOrDefault();

            Assert.NotNull(stockInfo);
            string key  = "cn_070013_20190812";
            var    perf = sdb.StockPerfs.Find(key);

            if (perf == null)
            {
                perf = new StockPerf()
                {
                    Id      = key,
                    Date    = new DateTime(2019, 8, 12),
                    StockId = "cn_070013",
                };
                sdb.StockPerfs.Add(perf);
            }
            perf.Close = 1.78m;
            sdb.SaveChanges();
        }
Esempio n. 5
0
 public StockPerfsController(StockDBContext context)
 {
     _context = context;
 }
Esempio n. 6
0
 public StatementsController(StockDBContext context)
 {
     _context = context;
 }
Esempio n. 7
0
 public MasterPortfoliosController(StockDBContext context)
 {
     _context = context;
 }
Esempio n. 8
0
 public UserRepository(StockDBContext context)
 {
     _context = context;
 }
 public StockCompaniesDataService(StockDBContext stockDBContext)
 {
     this.stockDBContext = stockDBContext;
 }
Esempio n. 10
0
 public StrategySubjectsController(StockDBContext context)
 {
     _context = context;
 }
Esempio n. 11
0
 public AdminRepository(StockDBContext context)
 {
     _context = context;
 }
 public AccountRepository(StockDBContext dbcontext)
 {
     this.dbcontext = dbcontext;
 }
 public AccountRepository(StockDBContext context)
 {
     this.context = context;
 }
Esempio n. 14
0
 /// <summary>
 /// Constructor para el controlador de la entidad Product
 /// </summary>
 /// <param name="context">DbContext</param>
 public StockController(StockDBContext context)
 {
     this._context    = context;
     this._negocioBLL = new StockBLL(new StockDAL(this._context));
 }
 public DepotController(StockDBContext context)
 {
     _context = context;
 }
Esempio n. 16
0
 public HomeController(StockDBContext context)
 {
     _context = context;
 }
Esempio n. 17
0
 public StrategiesController(StockDBContext context)
 {
     _context = context;
 }
Esempio n. 18
0
 public PortfolioHoldingsController(StockDBContext context) : base(context)
 {
 }
Esempio n. 19
0
 public StockBaseController(StockDBContext context)
 {
     _context = context;
 }
Esempio n. 20
0
 public AbsStockProcess(StockDBContext stockdbContext)
 {
     this.stockDBContext = stockdbContext;
 }
Esempio n. 21
0
 public AbsStockProcess()
 {
     this.stockDBContext = DataContextPool.GetDataContext <StockDBContext>();
 }
 public UserRepository(StockDBContext dbcontext)
 {
     this.dbcontext = dbcontext;
 }
Esempio n. 23
0
 public AdminRepository(StockDBContext dbcontext)
 {
     this.dbcontext = dbcontext;
 }
Esempio n. 24
0
 public StockInfoesController(StockDBContext context)
 {
     _context = context;
 }
Esempio n. 25
0
 /// <summary>
 /// Constructor para el la comunicacion con base de datos de la tabla Product
 /// </summary>
 /// <param name="context">DbContext</param>
 public StockDAL(StockDBContext context)
 {
     _context = context;
 }