예제 #1
0
        public void Save()
        {
            System.Data.SqlClient.SqlConnection txnConn = DAL.ProfitRecordings.GetOpenConnection("CryptoTrades");
            IDbTransaction Txn = txnConn.BeginTransaction();

            try
            {
                // save alert row changes.
                DAL.ProfitRecordings profitRecordings = new DAL.ProfitRecordings();
                profitRecordings.Txn = Txn;
                profitRecordings.Save(ref _id, _exchange, _currency, _lunoBid, _exchangeAsk, _currencyToZARExchangeRate, _profitPerc, _arbSymblol);

                // commit transaction
                Txn.Commit();
            }
            catch (Exception ex)
            {
                Txn.Rollback();

                throw ex;
            }
            finally
            {
                txnConn.Close();
                txnConn.Dispose();
                Txn.Dispose();
            }
        }
예제 #2
0
        public static ProfitRecordingCollection GetByExchangeAndCurrecyBetween(BLL.ProfitRecording.enExchange exchange, BLL.ProfitRecording.enCurrency currency, DateTime dtfrom, DateTime dtTo, int avgPerMinutes, string arbSymbol)
        {
            ProfitRecordingCollection obj = new ProfitRecordingCollection();
            DataSet ds = new DAL.ProfitRecordings().GetByExchangeAndCurrecy(exchange, currency, dtfrom, dtTo, avgPerMinutes, arbSymbol);

            obj.MapObjects(ds);
            return(obj);
        }
예제 #3
0
        public static ProfitRecording GetLatestByExchangeAndCurrnecy(enExchange exchange, enCurrency currency, string arbSymbol)
        {
            ProfitRecording obj = new ProfitRecording();
            DataSet         ds  = new DAL.ProfitRecordings().GetLatestByExchangeAndCurrnecy(exchange, currency, arbSymbol);

            if (obj.MapData(ds) == false)
            {
                obj = null;
            }

            return(obj);
        }
예제 #4
0
        public static ProfitRecording GetById(int id)
        {
            ProfitRecording obj = new ProfitRecording();
            DataSet         ds  = new DAL.ProfitRecordings().GetById(id);

            if (obj.MapData(ds) == false)
            {
                obj = null;
            }

            return(obj);
        }