Ejemplo n.º 1
0
        /// <summary>
        /// Инициализация потоков исторических данных
        /// </summary>
        /// <param name="insID">Инструмент</param>
        public void InitInsStores(int insID)
        {
            var isNewTran = _storage.BeginTransaction();

            try
            {
                foreach (var tf in _tfs)
                {
                    var insStore = _insStoreDA.GetInsStore(insID, tf);
                    if (insStore == null)
                    {
                        int insStoreID = _insStoreDA.CreateInsStore(insID, tf, true);
                        insStore = _insStoreDA.GetInsStoreByID(insStoreID);
                    }
                    BarRow bars = new BarRow(tf, insStore.InsID);
                    _insStore_barRow.Add(insStore, bars);

                    if (!_insID_barRows.ContainsKey(insID))
                    {
                        _insID_barRows.Add(insStore.InsID, new List <BarRow>());
                    }
                    _insID_barRows[insID].Add(bars);
                }
                _storage.Commit(isNewTran);
            }
            catch (Exception ex)
            {
                _storage.Rollback(isNewTran);
                _logger.AddException("InsStoreBL:CreateInsStore", ex);
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Получить объект InsStore по ID
 /// </summary>
 /// <param name="insStoreID">Идентификатор</param>
 /// <returns>InsStore or null</returns>
 public CommonData.InsStore GetInsStore(int insStoreID)
 {
     return(_insStoreDA.GetInsStoreByID(insStoreID));
 }