Exemple #1
0
        public void InsertAssetsDb(IList <Asset> listAssets, Guid userId, string company)
        {
            int    count  = 0;
            Cellar cellar = _cellarManager.GetAllCellars(company).FirstOrDefault();

            foreach (Asset asset in listAssets)
            {
                if (count < 500)
                {
                    _assetManager.Create(asset);
                    if (asset.Price < 1)
                    {
                        asset.Price = 1;
                    }

                    Stock stock = Stock.Create(cellar.Id, asset.Id, 1, asset.Price, userId, asset.CreationTime, company);
                    _stockManager.Create(stock);
                }
                count++;
            }
        }
Exemple #2
0
 public IList <Cellar> GetAllCellar(string company)
 {
     return(_cellarManager.GetAllCellars(company));
 }