public static int AddCurrencyRate(tCurrencyRate currencyRate) { try { return AccountingDataProvider.AddCurrencyRate(currencyRate); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static int AddCurrencyRate(tCurrencyRate currencyRate) { int rowsAdded; using (IDbConnection connection = DbConnectionHelper.GetConnection()) { var query = new StringBuilder( "INSERT INTO tCurrencyRate(Currency, Rate, RateDate)"); query.Append("VALUES(@Currency, @Rate,@RateDate)"); rowsAdded = connection.Execute(query.ToString(), currencyRate); } return rowsAdded; }
public static int UpdateCurrencyRate(tCurrencyRate currencyRate) { int rowsAdded; using (IDbConnection connection = DbConnectionHelper.GetConnection()) { var query = new StringBuilder( "UPDATE tCurrencyRate SET Currency = @Currency, "); query.Append("Rate = @Rate, RateDate = @RateDate WHERE Id = @Id"); rowsAdded = connection.Execute(query.ToString(), currencyRate); } return rowsAdded; }
public static int DeleteCurrencyRate(tCurrencyRate currencyRate) { int rowsAdded; using (IDbConnection connection = DbConnectionHelper.GetConnection()) { var query = new StringBuilder("DELETE FROM tCurrencyRate WHERE Id = @Id"); rowsAdded = connection.Execute(query.ToString(), currencyRate); } return rowsAdded; }