d8ecec8bb6
BillInventory Renamed. Refactored Bill to be more usable. Added Bill Detail Report. Added Open Bill and Bill Details Roles. Zero Rate Products have Yellow background Color. Refactored UserBI, FoodTableBI, ModifierBI, PrintLocationBI, ProductBI, ProductGroupBI, TaxBI, UserBI, Cached the Products List. Product and Product Group Form Working.
50 lines
1.5 KiB
C#
50 lines
1.5 KiB
C#
using System.Collections.Generic;
|
|
using Tanshu.Accounts.Entities;
|
|
using NHibernate;
|
|
|
|
namespace Tanshu.Accounts.Repository
|
|
{
|
|
public class ProductGroupBI : FluentBase<ProductGroup>
|
|
{
|
|
public ProductGroupBI()
|
|
: base()
|
|
{ }
|
|
|
|
public ProductGroupBI(bool beginTransaction)
|
|
: base(beginTransaction)
|
|
{ }
|
|
|
|
public ProductGroupBI(ISession session)
|
|
: base(session)
|
|
{ }
|
|
|
|
public ProductGroupBI(ISession session, bool beginTransaction)
|
|
: base(session, beginTransaction)
|
|
{ }
|
|
|
|
public new IList<ProductGroup> List()
|
|
{
|
|
return Session.QueryOver<ProductGroup>()
|
|
.OrderBy(x => x.Name).Asc
|
|
.List();
|
|
}
|
|
public IList<string> GetProductGroupTypes()
|
|
{
|
|
const string query = @"select distinct(pg.GroupType) from ProductGroup pg order by pg.GroupType";
|
|
var hnq = Session.CreateQuery(query);
|
|
return hnq.List<string>();
|
|
}
|
|
public ProductGroup GetProductGroupOfProduct(int productID)
|
|
{
|
|
using (var session = SessionManager.Session)
|
|
{
|
|
var item = (from p in session.QueryOver<Product>()
|
|
where p.ProductID == productID
|
|
select p.ProductGroup).SingleOrDefault<ProductGroup>();
|
|
NHibernateUtil.Initialize(item);
|
|
return item;
|
|
}
|
|
}
|
|
}
|
|
}
|