narsil/Tanshu.Accounts.Repository/PrintLocationBI.cs

32 lines
1.0 KiB
C#
Raw Normal View History

using System.Configuration;
using NHibernate;
using Tanshu.Accounts.Entities;
using System;
namespace Tanshu.Accounts.Repository
{
public class PrintLocationBI : UnitOfWork<PrintLocation>
{
public static PrintLocation BasePrinter
{
get
{
var location = ConfigurationManager.AppSettings["Location"].ToLowerInvariant();
using (var bi = new PrintLocationBI())
{
return bi.Get(x => x.Location == location && x.ProductGroup == null);
}
}
}
public static PrintLocation KotPrinter(Guid productGroupID)
{
var location = ConfigurationManager.AppSettings["Location"].ToLowerInvariant();
using (var bi = new PrintLocationBI())
{
return bi.Get(x => x.Location == location && x.ProductGroup.ProductGroupID == productGroupID) ??
bi.Get(x => x.Location == location && x.ProductGroup == null);
}
}
}
}