using System; using System.Collections.Generic; using Tanshu.Accounts.Contracts; namespace Tanshu.Accounts.BI { public class CustomerBI { public CustomerBO GetCustomer(Guid customerID) { using (var connection = new SqlDAO.SqlConnectionDAO()) { using (var dao = new SqlDAO.CustomerDAO(connection)) { return dao.GetCustomer(customerID); } } } public List GetCustomers() { using (var connection = new SqlDAO.SqlConnectionDAO()) { using (var dao = new SqlDAO.CustomerDAO(connection)) { return dao.GetCustomers(); } } } public List GetSingleCustomers(Guid customerID) { using (var connection = new SqlDAO.SqlConnectionDAO()) { using (var dao = new SqlDAO.CustomerDAO(connection)) { return dao.GetCustomers(customerID); } } } public bool Update(CustomerBO customer) { using (var connection = new SqlDAO.SqlConnectionDAO()) { using (var dao = new SqlDAO.CustomerDAO(connection)) { dao.Update(customer); return true; } } } public bool Delete(Guid customerID) { using (var connection = new SqlDAO.SqlConnectionDAO()) { using (var dao = new SqlDAO.CustomerDAO(connection)) { dao.Delete(customerID); return true; } } } public bool Insert(CustomerBO customer) { using (var connection = new SqlDAO.SqlConnectionDAO()) { using (var dao = new SqlDAO.CustomerDAO(connection)) { dao.Insert(customer); return true; } } } } }