96 lines
2.4 KiB
C#
96 lines
2.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using Tanshu.Accounts.Contracts;
|
|
|
|
namespace Tanshu.Accounts.BI
|
|
{
|
|
public class WaiterBI
|
|
{
|
|
public bool Insert(WaiterBO waiter)
|
|
{
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
|
{
|
|
using (var dao = new SqlDAO.WaiterDAO(connection))
|
|
{
|
|
|
|
return dao.Insert(waiter);
|
|
}
|
|
}
|
|
}
|
|
public bool Update(WaiterBO waiter)
|
|
{
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
|
{
|
|
using (var dao = new SqlDAO.WaiterDAO(connection))
|
|
{
|
|
|
|
return dao.Update(waiter);
|
|
}
|
|
}
|
|
}
|
|
public bool Delete(Guid waiterID)
|
|
{
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
|
{
|
|
using (var dao = new SqlDAO.WaiterDAO(connection))
|
|
{
|
|
|
|
return dao.Delete(waiterID);
|
|
}
|
|
}
|
|
}
|
|
|
|
public WaiterBO GetWaiter(Guid waiterID)
|
|
{
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
|
{
|
|
using (var dao = new SqlDAO.WaiterDAO(connection))
|
|
{
|
|
|
|
return dao.GetWaiter(waiterID);
|
|
}
|
|
}
|
|
}
|
|
public WaiterBO GetWaiter(int code)
|
|
{
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
|
{
|
|
using (var dao = new SqlDAO.WaiterDAO(connection))
|
|
{
|
|
|
|
return dao.GetWaiter(code);
|
|
}
|
|
}
|
|
}
|
|
public List<WaiterBO> GetWaiters()
|
|
{
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
|
{
|
|
using (var dao = new SqlDAO.WaiterDAO(connection))
|
|
{
|
|
|
|
return dao.GetWaiters();
|
|
}
|
|
}
|
|
}
|
|
public List<WaiterBO> GetFilteredWaiters(Dictionary<string, string> filter)
|
|
{
|
|
|
|
using (var connection = new SqlDAO.SqlConnectionDAO())
|
|
{
|
|
using (var dao = new SqlDAO.WaiterDAO(connection))
|
|
{
|
|
|
|
return dao.GetFilteredWaiters(filter);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|