narsil/Tanshu.Accounts.Repository/PrintLocationBI.cs
2014-10-16 16:45:03 +05:30

32 lines
1.0 KiB
C#

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);
}
}
}
}