Skip to content

Instantly share code, notes, and snippets.

@kkadir
Last active September 28, 2017 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkadir/93d5dac77f83d15ac86880563cc59cd3 to your computer and use it in GitHub Desktop.
Save kkadir/93d5dac77f83d15ac86880563cc59cd3 to your computer and use it in GitHub Desktop.
public void EvaluateCustomerDepositStatusforEnrollment()
{
try
{
...
// Get customer list with status "L - Letter Generated"
var lstCustomerDepositData = depositEvaluationTask.GetCustomersListByStatus(CustomerStatusOption.EnrollmentProcessing_LetterGenerated);
if (lstCustomerDepositData == null || lstCustomerDepositData.Count.Equals(0)) return; // <== This line returns if there aren't any customers with the "L - Letter Generated" status
foreach (var customer in lstCustomerDepositData)
{
depositEvaluationTask.Process(customer.CustomerId);
}
// Get customer list with status "D - Deposit Pending"
var lstCustomerDepositDataPending = depositEvaluationTask.GetCustomersListByStatus(CustomerStatusOption.EnrollmentProcessing_DepositPending); // <== This line will never be reached if there aren't any customers with the "L - Letter Generated" status
if (lstCustomerDepositDataPending == null || lstCustomerDepositData.Count.Equals(0)) return;
foreach (var customer in lstCustomerDepositDataPending)
{
depositEvaluationTask.Process(customer.CustomerId);
}
}
catch (Exception ex)
{
Manager.Publish(ex);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment