COA.EnterpriseServices/COA.EnterpriseServices.Creditors/CreditorLibrary.cs

44 lines
1.2 KiB
C#
Raw Normal View History

using COA.EnterpriseServices.DataAccess.Helpers;
2020-10-15 12:48:11 +00:00
namespace COA.EnterpriseServices.Creditors
{
2020-10-15 12:48:11 +00:00
public class CreditorLibrary
{
private readonly CreditorHelper creditorHelper;
2020-10-15 12:48:11 +00:00
public CreditorLibrary(CreditorHelper creditorHelper)
{
this.creditorHelper = creditorHelper;
}
2020-10-16 13:54:09 +00:00
public Creditor GetCreditor(int creditorId)
{
return creditorHelper.GetCreditor(creditorId);
}
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)
{
2020-10-16 02:17:27 +00:00
var creditor = creditorHelper.GetCreditor(response.CreditorId);
2020-10-16 02:17:27 +00:00
// manipulate creditor object directly
creditorHelper.UpdateCreditor(creditor);
// or have individual methods
creditorHelper.SetOriginalCreditorAsPrimary(response.CreditorId);
}
}
}