narsil/Tanshu.Accounts.BI/PrintLocationBI.cs

70 lines
2.4 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Text;
using Tanshu.Accounts.Contracts;
using Tanshu.Accounts.DAOFactory;
using System.Data.SqlClient;
using Tanshu.Data.DAO;
namespace Tanshu.Accounts.BI
{
public class PrintLocationBI : IPrintLocationBI
{
public void Insert(PrintLocationBO printLocation)
{
GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType);
using (IConnectionDAO connection = factory.Connection)
{
using (IPrintLocationDAO dao = factory.GetPrintLocationDAO(connection))
{
dao.Insert(printLocation);
}
}
}
public void Update(PrintLocationBO printLocation)
{
GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType);
using (IConnectionDAO connection = factory.Connection)
{
using (IPrintLocationDAO dao = factory.GetPrintLocationDAO(connection))
{
dao.Update(printLocation);
}
}
}
public bool Delete(int tableID)
{
GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType);
using (IConnectionDAO connection = factory.Connection)
{
using (IPrintLocationDAO dao = factory.GetPrintLocationDAO(connection))
{
return dao.Delete(tableID);
}
}
}
public PrintLocationBO GetPrintLocation(int printLocationID)
{
GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType);
using (IConnectionDAO connection = factory.Connection)
{
using (IPrintLocationDAO dao = factory.GetPrintLocationDAO(connection))
{
return dao.GetPrintLocation(printLocationID);
}
}
}
public PrintLocationBO GetPrintLocation(Guid productTypeID, string location)
{
GetFactory factory = GetFactory.GetDAOFactory(Database.GetFactoryType);
using (IConnectionDAO connection = factory.Connection)
{
using (IPrintLocationDAO dao = factory.GetPrintLocationDAO(connection))
{
return dao.GetPrintLocation(productTypeID, location);
}
}
}
}
}