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