2011-06-23 12:47:48 +00:00
|
|
|
|
using System.Configuration;
|
2011-06-29 20:27:07 +00:00
|
|
|
|
using NHibernate;
|
2011-01-30 07:14:05 +00:00
|
|
|
|
using Tanshu.Accounts.Entities;
|
2014-10-12 09:41:45 +00:00
|
|
|
|
using System;
|
2011-01-30 07:14:05 +00:00
|
|
|
|
|
|
|
|
|
namespace Tanshu.Accounts.Repository
|
|
|
|
|
{
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public class PrintLocationBI : UnitOfWork<PrintLocation>
|
2011-01-30 07:14:05 +00:00
|
|
|
|
{
|
|
|
|
|
public static PrintLocation BasePrinter
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2011-06-23 12:47:48 +00:00
|
|
|
|
var location = ConfigurationManager.AppSettings["Location"].ToLowerInvariant();
|
2014-10-12 09:41:45 +00:00
|
|
|
|
using (var bi = new PrintLocationBI())
|
|
|
|
|
{
|
2011-06-23 12:47:48 +00:00
|
|
|
|
return bi.Get(x => x.Location == location && x.ProductGroup == null);
|
2014-10-12 09:41:45 +00:00
|
|
|
|
}
|
2011-01-30 07:14:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public static PrintLocation KotPrinter(Guid productGroupID)
|
2011-01-30 07:14:05 +00:00
|
|
|
|
{
|
2011-06-23 12:47:48 +00:00
|
|
|
|
var location = ConfigurationManager.AppSettings["Location"].ToLowerInvariant();
|
2014-10-12 09:41:45 +00:00
|
|
|
|
using (var bi = new PrintLocationBI())
|
|
|
|
|
{
|
2011-06-23 12:47:48 +00:00
|
|
|
|
return bi.Get(x => x.Location == location && x.ProductGroup.ProductGroupID == productGroupID) ??
|
|
|
|
|
bi.Get(x => x.Location == location && x.ProductGroup == null);
|
2014-10-12 09:41:45 +00:00
|
|
|
|
}
|
2011-01-30 07:14:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|