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(); } }
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); }
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); }
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); }