2011-01-30 07:14:05 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using Tanshu.Accounts.Contracts;
|
|
|
|
|
using System.Data.SqlClient;
|
|
|
|
|
using Tanshu.Data.DAO;
|
|
|
|
|
using Tanshu.Accounts.Entities;
|
|
|
|
|
using Tanshu.Accounts.SqlDAO;
|
2011-02-04 19:30:55 +00:00
|
|
|
|
using NHibernate;
|
2011-01-30 07:14:05 +00:00
|
|
|
|
|
|
|
|
|
namespace Tanshu.Accounts.Repository
|
|
|
|
|
{
|
|
|
|
|
public class FoodTableBI
|
|
|
|
|
{
|
2011-02-04 19:30:55 +00:00
|
|
|
|
ISession session;
|
|
|
|
|
public FoodTableBI()
|
|
|
|
|
{
|
|
|
|
|
this.session = SessionManager.Session;
|
|
|
|
|
}
|
|
|
|
|
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public void Insert(FoodTable foodTable)
|
|
|
|
|
{
|
2011-02-04 19:30:55 +00:00
|
|
|
|
session.Save(foodTable);
|
2011-01-30 07:14:05 +00:00
|
|
|
|
}
|
|
|
|
|
public void Update(FoodTable foodTable)
|
|
|
|
|
{
|
2011-02-04 19:30:55 +00:00
|
|
|
|
session.Update(foodTable);
|
2011-01-30 07:14:05 +00:00
|
|
|
|
}
|
|
|
|
|
public void Delete(int foodTableID)
|
|
|
|
|
{
|
2011-02-04 19:30:55 +00:00
|
|
|
|
session.Delete(new FoodTable() { FoodTableID = foodTableID });
|
|
|
|
|
}
|
|
|
|
|
public FoodTable Get(int foodTableID)
|
|
|
|
|
{
|
|
|
|
|
return session.Get<FoodTable>(foodTableID);
|
2011-01-30 07:14:05 +00:00
|
|
|
|
}
|
2011-02-04 19:30:55 +00:00
|
|
|
|
public IList<FoodTable> List()
|
2011-01-30 07:14:05 +00:00
|
|
|
|
{
|
2011-02-04 19:30:55 +00:00
|
|
|
|
return session.CreateCriteria<FoodTable>().List<FoodTable>();
|
2011-01-30 07:14:05 +00:00
|
|
|
|
}
|
2011-02-04 19:30:55 +00:00
|
|
|
|
public void Dispose()
|
2011-01-30 07:14:05 +00:00
|
|
|
|
{
|
2011-02-04 19:30:55 +00:00
|
|
|
|
session.Dispose();
|
2011-01-30 07:14:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|