narsil/Tanshu.Accounts.SqlDAO/BusinessLayer/FoodTableBI.cs

47 lines
1.1 KiB
C#
Raw Normal View History

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;
using NHibernate;
namespace Tanshu.Accounts.Repository
{
public class FoodTableBI
{
ISession session;
public FoodTableBI()
{
this.session = SessionManager.Session;
}
public void Insert(FoodTable foodTable)
{
session.Save(foodTable);
}
public void Update(FoodTable foodTable)
{
session.Update(foodTable);
}
public void Delete(int foodTableID)
{
session.Delete(new FoodTable() { FoodTableID = foodTableID });
}
public FoodTable Get(int foodTableID)
{
return session.Get<FoodTable>(foodTableID);
}
public IList<FoodTable> List()
{
return session.CreateCriteria<FoodTable>().List<FoodTable>();
}
public void Dispose()
{
session.Dispose();
}
}
}