0172fc4e01
Added Nc Option in settlement Merged Vouchers and SaleVoucher table. Need to update the Sql Schema
79 lines
2.2 KiB
C#
79 lines
2.2 KiB
C#
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<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;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|