public List <Expense> GetExpenses() { List <Expense> expenses = new List <Expense>(); using (var DataWrapper = new Utilities.DataWrapper()) { var reader = DataWrapper.Query("GetExpenses"); while (reader.Read()) { expenses.Add( new Expense() { ExpenseId = Helpers.GetIntValue(reader, "ExpenseId"), UserId = Helpers.GetIntValue(reader, "UserId"), ExpenseDate = Convert.ToDateTime(reader["ExpenseDate"]), ExpenseTypeId = Helpers.GetIntValue(reader, "ExpenseTypeId"), ExpenseTypeDescription = Helpers.GetStringValue(reader, "ExpenseTypeDescription"), ExpenseAmount = Convert.ToDouble(reader["ExpenseAmount"]), BranchCode = Helpers.GetStringValue(reader, "BranchCode"), VendorName = Helpers.GetStringValue(reader, "VendorName"), LastFourCcNumber = Helpers.GetStringValue(reader, "LastFourCcNumber"), //Note = Helpers.GetStringValue(reader, "Notes"), Notes = Helpers.GetListValue(reader, "Notes"), StatusId = Helpers.GetIntValue(reader, "StatusId"), StatusDescription = Helpers.GetStringValue(reader, "StatusDescription"), ReceiptFileName = Helpers.GetStringValue(reader, "ReceiptFileName"), DisplayReceiptImage = (Byte[])reader["Receipt"] }); } } return(expenses); }
public static List <ExpenseType> GetExpenseTypes() { List <ExpenseType> expenseTypes = new List <ExpenseType>(); using (var DataWrapper = new Utilities.DataWrapper()) { var reader = DataWrapper.Query("GetExpenseTypes"); while (reader.Read()) { expenseTypes.Add( new ExpenseType() { ExpenseTypeId = (int)reader["ExpenseTypeId"], ExpenseTypeDescription = (string)reader["ExpenseTypeDescription"] }); } } return(expenseTypes); }