COA.EnterpriseServices/COA.EnterpriseServices.Sandbox/Program.cs

54 lines
1.4 KiB
C#
Raw Normal View History

2020-10-14 21:57:39 +00:00
using COA.EnterpriseServices.DataAccess;
using COA.EnterpriseServices.DataAccess.Entities;
2020-10-14 12:35:14 +00:00
using COA.EnterpriseServices.DataAccess.Helpers;
2020-10-14 01:46:23 +00:00
namespace COA.EnterpriseServices.Sandbox
{
2020-10-14 12:35:14 +00:00
internal class Program
2020-10-14 01:46:23 +00:00
{
2020-10-14 12:35:14 +00:00
private static void Main(string[] args)
{
ClientStuff();
2020-10-14 16:43:46 +00:00
CreditorStuff();
}
private static void CreditorStuff()
2020-10-14 01:46:23 +00:00
{
2020-10-14 21:57:39 +00:00
var creditorHelper = Dependencies.Container.GetInstance<CreditorHelper>();
2020-10-14 03:10:25 +00:00
2020-10-14 12:35:14 +00:00
// get single creditor
2020-10-14 16:23:04 +00:00
var singleCreditor = creditorHelper.GetCreditor(1);
2020-10-14 03:10:25 +00:00
2020-10-14 12:35:14 +00:00
// search creditors
var searchedCreditors = creditorHelper.FindByName("Guy");
2020-10-14 03:10:25 +00:00
2020-10-14 12:35:14 +00:00
// search active creditors
var activeCreditors = creditorHelper.FindByStatus("Active");
2020-10-14 03:10:25 +00:00
2020-10-14 12:35:14 +00:00
var newCreditor = new Creditor
2020-10-14 03:10:25 +00:00
{
2020-10-14 12:35:14 +00:00
ClientFirstName = "New",
ClientLastName = "Guy",
Status = "Active"
};
2020-10-14 16:23:04 +00:00
creditorHelper.AddCreditor(newCreditor);
2020-10-14 01:46:23 +00:00
}
2020-10-14 12:35:14 +00:00
private static void ClientStuff()
{
2020-10-14 21:57:39 +00:00
var clientHelper = Dependencies.Container.GetInstance<ClientHelper>();
var newClient = new Client
{
FirstName = "Ryan",
LastName = "Peters",
Email = "ryan@binarydad.com",
Phone = 4102183673
};
2020-10-14 12:35:14 +00:00
clientHelper.Add(newClient);
}
2020-10-14 01:46:23 +00:00
}
}