narsil/Tanshu.Accounts.BI/LedgerBI.cs

77 lines
2.1 KiB
C#
Raw Normal View History

2010-03-02 17:56:21 +00:00
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())
2010-03-02 17:56:21 +00:00
{
using (var dao = new SqlDAO.LedgerDAO(connection))
2010-03-02 17:56:21 +00:00
{
return dao.GetLedger(ledgerID);
}
}
}
public LedgerBO GetLedgerByName(string name)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
2010-03-02 17:56:21 +00:00
{
using (var dao = new SqlDAO.LedgerDAO(connection))
2010-03-02 17:56:21 +00:00
{
return dao.GetLedger(name);
}
}
}
public bool Insert(LedgerBO ledger)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
2010-03-02 17:56:21 +00:00
{
using (var dao = new SqlDAO.LedgerDAO(connection))
2010-03-02 17:56:21 +00:00
{
return dao.Insert(ledger);
}
}
}
public bool Update(LedgerBO ledger)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
2010-03-02 17:56:21 +00:00
{
using (var dao = new SqlDAO.LedgerDAO(connection))
2010-03-02 17:56:21 +00:00
{
return dao.Update(ledger);
}
}
}
public List<LedgerDisplayBO> GetLedgers()
{
using (var connection = new SqlDAO.SqlConnectionDAO())
2010-03-02 17:56:21 +00:00
{
using (var dao = new SqlDAO.LedgerDAO(connection))
2010-03-02 17:56:21 +00:00
{
return dao.GetLedgers();
}
}
}
public List<LedgerDisplayBO> GetLedgersOfType(char type)
{
using (var connection = new SqlDAO.SqlConnectionDAO())
2010-03-02 17:56:21 +00:00
{
using (var dao = new SqlDAO.LedgerDAO(connection))
2010-03-02 17:56:21 +00:00
{
return dao.GetLedgers(type);
}
}
}
}
}