public void Save() { System.Data.SqlClient.SqlConnection txnConn = DAL.ProfitRecordings.GetOpenConnection("CryptoTrades"); IDbTransaction Txn = txnConn.BeginTransaction(); try { // save alert row changes. DAL.DollarCostAvg dollarcostavg = new DAL.DollarCostAvg(); dollarcostavg.Txn = Txn; dollarcostavg.Save(ref _id, _theDate, _btcUsd, _btc, _usd); // commit transaction Txn.Commit(); } catch (Exception ex) { Txn.Rollback(); throw ex; } finally { txnConn.Close(); txnConn.Dispose(); Txn.Dispose(); } }
public static DollarCostAvgCollection GetAll() { DollarCostAvgCollection obj = new DollarCostAvgCollection(); DataSet ds = new DAL.DollarCostAvg().GetAll(); obj.MapObjects(ds); return(obj); }
public static DollarCostAvg GetById(int id) { DollarCostAvg obj = new DollarCostAvg(); DataSet ds = new DAL.DollarCostAvg().GetById(id); if (obj.MapData(ds) == false) { obj = null; } return(obj); }