39 lines
1.0 KiB
C#
39 lines
1.0 KiB
C#
using COA.EnterpriseServices.DataAccess.Helpers;
|
|
|
|
namespace COA.EnterpriseServices.Creditors
|
|
{
|
|
public class CreditorLibrary
|
|
{
|
|
private readonly CreditorHelper creditorHelper;
|
|
|
|
public CreditorLibrary(CreditorHelper creditorHelper)
|
|
{
|
|
this.creditorHelper = creditorHelper;
|
|
}
|
|
|
|
public string GetCreditorStatus(int creditorId)
|
|
{
|
|
var creditor = creditorHelper.GetCreditor(creditorId);
|
|
|
|
return creditor.creditorStatus;
|
|
}
|
|
|
|
public bool SetCreditorStatus(int creditorId, string status)
|
|
{
|
|
return creditorHelper.SetCreditorStatus(creditorId, status);
|
|
}
|
|
|
|
public void AddOfferResponse(OfferResponse response)
|
|
{
|
|
var creditor = creditorHelper.GetCreditor(response.CreditorId);
|
|
|
|
// manipulate creditor object directly
|
|
|
|
creditorHelper.UpdateCreditor(creditor);
|
|
|
|
// or have individual methods
|
|
creditorHelper.SetOriginalCreditorAsPrimary(response.CreditorId);
|
|
}
|
|
}
|
|
}
|