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

52 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using Tanshu.Data.DAO;
using Tanshu.Accounts.Contracts;
using Tanshu.Accounts.Entities;
using Tanshu.Accounts.SqlDAO;
namespace Tanshu.Accounts.Repository
{
public static class ModifierBI
{
public static void Insert(Modifier modifier)
{
using (var session = SessionManager.Session)
{
session.Save(modifier);
}
}
public static void Update(Modifier modifier)
{
using (var session = SessionManager.Session)
{
session.Update(modifier);
}
}
public static void Delete(int modifierID)
{
using (var session = SessionManager.Session)
{
session.Delete(new Modifier() { ModifierID = modifierID });
}
}
public static Modifier GetModifier(int modifierID)
{
using (var session = SessionManager.Session)
{
return session.Get<Modifier>(modifierID);
}
}
public static IList<Modifier> GetModifiers()
{
using (var session = SessionManager.Session)
{
return session.CreateCriteria<Modifier>().List<Modifier>();
}
}
}
}