narsil/Tanshu.Accounts.BI/CustomerBI.cs
Amritanshu b6498a7b1c Feature: Sale analysis printout changed.
Feature: Sale analysis detail printing built
2013-11-16 11:31:58 +05:30

104 lines
2.9 KiB
C#

using System;
using System.Collections.Generic;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.BI
{
public class CustomerBI : ICustomerBI
{
public List<LedgerBO> GetCustomerLedgers()
{
using (var connection = new SqlDAO.SqlConnectionDAO())
{
using (var dao = new SqlDAO.CustomerDAO(connection))
{
return dao.GetCustomerLedgers();
}
}
}
public CustomerBO GetCustomer(Guid customerID)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
{
using (var dao = new SqlDAO.CustomerDAO(connection))
{
return dao.GetCustomer(customerID);
}
}
}
public List<CustomerBO> GetFilteredCustomers(Dictionary<string, string> filter)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
{
using (var dao = new SqlDAO.CustomerDAO(connection))
{
return dao.GetFilteredCustomers(filter);
}
}
}
public List<CustomerBO> GetCustomers()
{
using (var connection = new SqlDAO.SqlConnectionDAO())
{
using (var dao = new SqlDAO.CustomerDAO(connection))
{
return dao.GetCustomers();
}
}
}
public List<CustomerBO> 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;
}
}
}
}
}