public static int AddCurrency(tCurrency currency) { try { return AccountingDataProvider.AddCurrency(currency); } catch (Exception exception) { throw new Exception(exception.Message); } }
public static int AddCurrency(tCurrency currency) { int rowsAdded; using (IDbConnection connection = DbConnectionHelper.GetConnection()) { var query = new StringBuilder( "INSERT INTO tCurrency(Code, Description, Note,Sign,CurrentRate,LastRate,UpdateDateTime)"); query.Append("VALUES(@Code, @Description, @Note,@Sign,@CurrentRate,@LastRate,@UpdateDateTime)"); rowsAdded = connection.Execute(query.ToString(), currency); } return rowsAdded; }
public static int UpdateCurrency(tCurrency currency) { int rowsAdded; using (IDbConnection connection = DbConnectionHelper.GetConnection()) { var query = new StringBuilder( "UPDATE tCurrency SET Description = @Description,Note = @Note,Sign=@Sign,CurrentRate=@CurrentRate,LastRate=@LastRate,UpdateDateTime=@UpdateDateTime "); query.Append(" WHERE Code = @Code"); rowsAdded = connection.Execute(query.ToString(), currency); } return rowsAdded; }
public static int DeleteCurrency(tCurrency currency) { int rowsAdded; using (IDbConnection connection = DbConnectionHelper.GetConnection()) { var query = new StringBuilder("DELETE FROM tCurrency WHERE Code = @Code"); rowsAdded = connection.Execute(query.ToString(), currency); } return rowsAdded; }