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

77 lines
2.1 KiB
C#

using System;
using System.Collections.Generic;
using Tanshu.Accounts.Contracts;
namespace Tanshu.Accounts.BI
{
public class LedgerBI : ILedgerBI
{
public LedgerBO GetLedger(Guid ledgerID)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
{
using (var dao = new SqlDAO.LedgerDAO(connection))
{
return dao.GetLedger(ledgerID);
}
}
}
public LedgerBO GetLedgerByName(string name)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
{
using (var dao = new SqlDAO.LedgerDAO(connection))
{
return dao.GetLedger(name);
}
}
}
public bool Insert(LedgerBO ledger)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
{
using (var dao = new SqlDAO.LedgerDAO(connection))
{
return dao.Insert(ledger);
}
}
}
public bool Update(LedgerBO ledger)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
{
using (var dao = new SqlDAO.LedgerDAO(connection))
{
return dao.Update(ledger);
}
}
}
public List<LedgerDisplayBO> GetLedgers()
{
using (var connection = new SqlDAO.SqlConnectionDAO())
{
using (var dao = new SqlDAO.LedgerDAO(connection))
{
return dao.GetLedgers();
}
}
}
public List<LedgerDisplayBO> GetLedgersOfType(char type)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
{
using (var dao = new SqlDAO.LedgerDAO(connection))
{
return dao.GetLedgers(type);
}
}
}
}
}