54 lines
1.4 KiB
C#
54 lines
1.4 KiB
C#
using COA.EnterpriseServices.DataAccess;
|
|
using COA.EnterpriseServices.DataAccess.Entities;
|
|
using COA.EnterpriseServices.DataAccess.Helpers;
|
|
|
|
namespace COA.EnterpriseServices.Sandbox
|
|
{
|
|
internal class Program
|
|
{
|
|
private static void Main(string[] args)
|
|
{
|
|
//ClientStuff();
|
|
CreditorStuff();
|
|
}
|
|
|
|
private static void CreditorStuff()
|
|
{
|
|
var creditorHelper = Dependencies.Container.GetInstance<CreditorHelper>();
|
|
|
|
// get single creditor
|
|
var singleCreditor = creditorHelper.GetCreditor(1);
|
|
|
|
// search creditors
|
|
var searchedCreditors = creditorHelper.FindByName("Guy");
|
|
|
|
// search active creditors
|
|
var activeCreditors = creditorHelper.FindByStatus("Active");
|
|
|
|
var newCreditor = new Creditor
|
|
{
|
|
ClientFirstName = "New",
|
|
ClientLastName = "Guy",
|
|
Status = "Active"
|
|
};
|
|
|
|
creditorHelper.AddCreditor(newCreditor);
|
|
}
|
|
|
|
private static void ClientStuff()
|
|
{
|
|
var clientHelper = Dependencies.Container.GetInstance<ClientHelper>();
|
|
|
|
var newClient = new Client
|
|
{
|
|
FirstName = "Ryan",
|
|
LastName = "Peters",
|
|
Email = "ryan@binarydad.com",
|
|
Phone = 4102183673
|
|
};
|
|
|
|
clientHelper.Add(newClient);
|
|
}
|
|
}
|
|
}
|