32 lines
1.0 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|
|
}
|