SupplierDiscountSetDAL.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.ViewModel.TeachingMaterial;
  6. using System.Linq.Expressions;
  7. using EMIS.Entities;
  8. using EMIS.DataLogic.Repositories;
  9. namespace EMIS.DataLogic.Common.TeachingMaterial
  10. {
  11. public class SupplierDiscountSetDAL
  12. {
  13. public SupplierDiscountSetRepository supplierDiscountSetRepository { get; set; }
  14. public PublishRepository publishRepository { get; set; }
  15. public IQueryable<SupplierDiscountSetView> GetSupplierDiscountSetGridView(Expression<Func<ET_SupplierDiscountSet, bool>> exp)
  16. {
  17. var query = from supset in supplierDiscountSetRepository.GetList(exp)
  18. join pub in publishRepository.Entities
  19. on supset.PublishID equals pub.PublishID
  20. select new SupplierDiscountSetView
  21. {
  22. SupplierDiscountSetID = supset.SupplierDiscountSetID,
  23. IsDefault = supset.IsDefault.Value,
  24. Discount = supset.Discount,
  25. PublishID = supset.PublishID,
  26. UnitCode = pub.UnitCode,
  27. UnitName = pub.UnitName,
  28. };
  29. return query;
  30. }
  31. }
  32. }