narsil/Tanshu.Accounts.Repository/BusinessLayer/PrintLocationBI.cs

26 lines
962 B
C#
Raw Normal View History

using System.Configuration;
using Tanshu.Accounts.Entities;
namespace Tanshu.Accounts.Repository
{
public class PrintLocationBI : FluentBase<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(int 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);
}
}
}