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.GetBusinessObject(connection.ExecuteReader(cmd)); } public List GetFoodTables() { using (SqlCommand cmd = new SqlCommand("SELECT * FROM FoodTables")) { return BusinessObjectDAO.GetBusinessObjects(connection.ExecuteReader(cmd)); } } } }