Exemple #1
0
        private void AddPosTrade(int posID, int tradeID)
        {
            PosTrade pt = new PosTrade(posID, tradeID);

            pt.IsNew = true;
            _posTrades.Add(pt);
        }
Exemple #2
0
        /// <summary>
        /// Add PosTrade relation
        /// </summary>
        /// <param name="posID">Position id</param>
        /// <param name="tradeID">Trade id</param>
        public void AddPosTrade(int posID, int tradeID)
        {
            PosTrade pt = new PosTrade(posID, tradeID);

            using (var db = new DaContext(_options))
            {
                db.PosTrade.Add(pt);
                db.SaveChanges();
            }
        }
Exemple #3
0
        public void AddPosTrade(int posID, int tradeID)
        {
            if (_posTrades.Any(r => r.PosID == posID && r.TradeID == tradeID))
            {
                throw new Exception("dublicate");
            }
            PosTrade pt = new PosTrade(posID, tradeID);

            _posTrades.Add(pt);
        }