narsil/Tanshu.Accounts.Repository/BusinessLayer/PrintLocationBI.cs
tanshu 69617949bd Important! : Need to update to new schema using SQL Scripts
Important! : This version will not work.  It is pre-alpha and saved in case of catastrophic failure
Refactor: Remove dependency on Fluent Nhibernate.
Refactor: All Primary keys are now Guids.
Refactor: Class Mappings changed from AutoMap to Explicit Mappings.
Breakage: All Cascading is now disabled and entities must be explicitly saved/updated/deleted
Breakage: Auto Commiting is now off and "SaveChanges()" needs to be called on all BIs.
Refactor: Changed the pattern where all relevant db code for an operation is basically in the same function.
Chore: Removed Advance and Payments options.
2014-10-12 15:11:45 +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);
}
}
}
}