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

59 lines
1.5 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;
namespace Tanshu.Accounts.Repository
{
public static class WaiterBI
{
public static void Insert(Waiter waiter)
{
using (var session = SessionManager.Session)
{
session.Save(waiter);
}
}
public static void Update(Waiter waiter)
{
using (var session = SessionManager.Session)
{
session.Update(waiter);
}
}
public static bool Delete(int waiterID)
{
using (var session = SessionManager.Session)
{
session.Delete(new Waiter() { WaiterID = waiterID });
return true;
}
}
public static Waiter GetWaiter(int waiterID)
{
using (var session = SessionManager.Session)
{
return session.Get<Waiter>(waiterID);
}
}
public static IList<Waiter> GetWaiters()
{
using (var session = SessionManager.Session)
{
return session.CreateCriteria<Waiter>()
.List<Waiter>();
}
}
public static IList<Waiter> GetFilteredWaiters(Dictionary<string, string> filter)
{
throw new NotImplementedException();
}
}
}