53 lines
1.7 KiB
C#
53 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data.SqlClient;
|
|
using Tanshu.Accounts.Contracts;
|
|
using Tanshu.Data.DAO;
|
|
using Tanshu.Accounts.DAOFactory;
|
|
using FluentNHibernate.Automapping;
|
|
using FluentNHibernate.Cfg;
|
|
|
|
namespace Tanshu.Accounts.SqlDAO
|
|
{
|
|
public class FoodTableDAO : BaseDAO, IFoodTableDAO
|
|
{
|
|
public FoodTableDAO(IConnectionDAO connection)
|
|
: base(connection)
|
|
{ }
|
|
|
|
public void Insert(FoodTableBO foodTable)
|
|
{
|
|
// AutoMap.AssemblyOf<FoodTableBO>();
|
|
// var sessionFactory = Fluently.Configure()
|
|
//.Database( d => d)
|
|
//.Mappings(m =>
|
|
// m.AutoMappings
|
|
// .Add(AutoMap.AssemblyOf<Product>()))
|
|
//.BuildSessionFactory();
|
|
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));
|
|
}
|
|
}
|
|
}
|
|
}
|