narsil/Tanshu.Accounts.SqlDAO/FoodTableDAO.cs

44 lines
1.3 KiB
C#
Raw Normal View History

2011-01-09 23:36:24 +00:00
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using Tanshu.Accounts.Contracts;
using Tanshu.Data.DAO;
using Tanshu.Accounts.DAOFactory;
namespace Tanshu.Accounts.SqlDAO
{
public class FoodTableDAO : BaseDAO, IFoodTableDAO
{
public FoodTableDAO(IConnectionDAO connection)
: base(connection)
{ }
public void Insert(FoodTableBO foodTable)
{
throw new NotImplementedException();
}
public void Update(FoodTableBO foodTable)
{
throw new NotImplementedException();
}
public bool Delete(int tableID)
{
throw new NotImplementedException();
}
public FoodTableBO GetFoodTable(int tableID)
{
SqlCommand cmd = new SqlCommand("SELECT * FROM FoodTables Where TableID = @TableID;");
cmd.Parameters.AddWithValue("@TableID", tableID);
return BusinessObjectDAO<FoodTableBO>.GetBusinessObject(connection.ExecuteReader(cmd));
}
public List<FoodTableBO> GetFoodTables()
{
using (SqlCommand cmd = new SqlCommand("SELECT * FROM FoodTables"))
{
return BusinessObjectDAO<FoodTableBO>.GetBusinessObjects(connection.ExecuteReader(cmd));
}
}
}
}