using System; using System.Collections.Generic; using System.Linq; using System.Text; using EMIS.ViewModel.TeachingMaterial; using System.Linq.Expressions; using EMIS.Entities; using EMIS.DataLogic.Repositories; namespace EMIS.DataLogic.Common.TeachingMaterial { public class SupplierDiscountSetDAL { public SupplierDiscountSetRepository supplierDiscountSetRepository { get; set; } public PublishRepository publishRepository { get; set; } public IQueryable GetSupplierDiscountSetGridView(Expression> exp) { var query = from supset in supplierDiscountSetRepository.GetList(exp) join pub in publishRepository.Entities on supset.PublishID equals pub.PublishID select new SupplierDiscountSetView { SupplierDiscountSetID = supset.SupplierDiscountSetID, IsDefault = supset.IsDefault.Value, Discount = supset.Discount, PublishID = supset.PublishID, UnitCode = pub.UnitCode, UnitName = pub.UnitName, }; return query; } } }