private static Account Create( int id, string firstName, string lastName, string email, string phoneNumber, decimal amountDue, string paymentDueDate, TimeSpan?offset, AccountStatuses accountStatus) { return(new Account { Id = id, FirstName = firstName, LastName = lastName, Email = email, PhoneNumber = phoneNumber, AmountDue = amountDue, PaymentDueDate = (string.IsNullOrWhiteSpace(paymentDueDate)) ? (DateTimeOffset?)null : new DateTimeOffset(Convert.ToDateTime(paymentDueDate), (TimeSpan)offset), AccountStatusId = (int)accountStatus }); }
/// <summary> /// ListAccountsByEmployee business method. /// </summary> /// <param name="startRowIndex">A startRowIndex value.</param> /// <param name="maximumRows">A maximumRows value.</param> /// <param name="sortExpression">A sortExpression value.</param> /// <param name="employee">A employee value.</param> /// <param name="category">A category value.</param> /// <param name="status">A status value.</param> /// <returns>Returns a List<Account> object.</returns> public List<Account> ListAccountsByEmployee(int maximumRows, int startRowIndex, string sortExpression, string employee, AccountCategories? category, AccountStatuses? status, out int totalRowCount) { List<Account> result = default(List<Account>); if (string.IsNullOrWhiteSpace(sortExpression)) sortExpression = "DateSubmitted DESC"; // Data access component declarations. var AccountDAC = new AccountDAL(); // Step 1 - Calling Select on AccountDAC. result = AccountDAC.Select(maximumRows, startRowIndex, sortExpression, employee, category, status); // Step 2 - Get count. totalRowCount = AccountDAC.Count(employee, category, status); return result; }