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;
|
|
|
|
|
|
|
|
|
|
namespace Tanshu.Accounts.Repository
|
|
|
|
|
{
|
2011-06-29 20:27:07 +00:00
|
|
|
|
public class PrintLocationBI : FluentGenericBase<PrintLocation>
|
2011-01-30 07:14:05 +00:00
|
|
|
|
{
|
2011-06-29 20:27:07 +00:00
|
|
|
|
public PrintLocationBI()
|
|
|
|
|
: base()
|
|
|
|
|
{ }
|
|
|
|
|
public PrintLocationBI(bool beginTransaction)
|
|
|
|
|
: base(beginTransaction)
|
|
|
|
|
{ }
|
|
|
|
|
public PrintLocationBI(ISession session)
|
|
|
|
|
: base(session)
|
|
|
|
|
{ }
|
|
|
|
|
public PrintLocationBI(ISession session, bool beginTransaction)
|
|
|
|
|
: base(session, beginTransaction)
|
|
|
|
|
{ }
|
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();
|
2011-06-29 20:27:07 +00:00
|
|
|
|
using (var bi = new PrintLocationBI(false))
|
2011-06-23 12:47:48 +00:00
|
|
|
|
return bi.Get(x => x.Location == location && x.ProductGroup == null);
|
2011-01-30 07:14:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public static PrintLocation KotPrinter(int productGroupID)
|
|
|
|
|
{
|
2011-06-23 12:47:48 +00:00
|
|
|
|
var location = ConfigurationManager.AppSettings["Location"].ToLowerInvariant();
|
2011-06-29 20:27:07 +00:00
|
|
|
|
using (var bi = new PrintLocationBI(false))
|
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);
|
2011-01-30 07:14:05 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|