narsil/Tanshu.Accounts.SqlDAO/FoodTableDAO.cs
2011-01-10 05:06:24 +05:30

44 lines
1.3 KiB
C#

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));
}
}
}
}