StockOutDetailServices.cs 5.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.DataLogic.Common.TeachingMaterial;
  6. using EMIS.ViewModel.TeachingMaterial;
  7. using Bowin.Common.Linq.Entity;
  8. using EMIS.ViewModel;
  9. namespace EMIS.CommonLogic.TeachingMaterial
  10. {
  11. public class StockOutDetailServices : BaseServices, IStockOutDetailServices
  12. {
  13. public StockOutDetailDAL StockOutDetailDAL { get; set; }
  14. public IGridResultSet<StockOutView> GetStockOutDetailViewGrid(ViewModel.ConfiguretView configuretView, Guid? schoolyearID, Guid? supplierID, DateTime? stockOutTimeStart, DateTime? stockOutTimeEnd, int pageIndex, int pageSize)
  15. {
  16. var query = StockOutDetailDAL.GetStockOutDetailGridView(x => true);
  17. query = query.Where(x => x.RecordStatus == (int)CF_GeneralPurpose.IsYes);//提取提交的统计数据
  18. if (schoolyearID.HasValue)
  19. query = query.Where(x => x.SchoolyearID == schoolyearID);
  20. if (supplierID.HasValue)
  21. query = query.Where(x => x.SupplierID == supplierID);
  22. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  23. return query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue).OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToGridResultSet<StockOutView>(pageIndex, pageSize);
  24. return query.OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToGridResultSet<StockOutView>(pageIndex, pageSize);
  25. }
  26. public IList<StockOutView> GetStockOutDetailViewList(ViewModel.ConfiguretView configuretView, Guid? schoolyearID, Guid? supplierID, DateTime? stockOutTimeStart, DateTime? stockOutTimeEnd)
  27. {
  28. var query = StockOutDetailDAL.GetStockOutDetailGridView(x => x.RecordStatus == (int)CF_GeneralPurpose.IsYes);
  29. if (schoolyearID.HasValue)
  30. query = query.Where(x => x.SchoolyearID == schoolyearID);
  31. if (supplierID.HasValue)
  32. query = query.Where(x => x.SupplierID == supplierID);
  33. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  34. return query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue).OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToList();
  35. return query.OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToList();
  36. }
  37. public IGridResultSet<StockOutView> GetStockOutStatisticsViewGrid(ConfiguretView configuretView, Guid? schoolyearID, Guid? supplierID, Guid? teachingMaterialID, int? teachingMaterialType,int? stockOutType, int pageIndex, int pageSize)
  38. {
  39. var query = StockOutDetailDAL.GetStockOutStatisticsGridView(x => x.RecordStatus == (int)CF_GeneralPurpose.IsYes);//提取提交的统计数据
  40. if (stockOutType>0)
  41. query = query.Where(x => x.StockOutTypeID == stockOutType);
  42. if (schoolyearID.HasValue)
  43. query = query.Where(x => x.SchoolyearID == schoolyearID);
  44. if (supplierID.HasValue)
  45. query = query.Where(x => x.SupplierID == supplierID);
  46. if (teachingMaterialID.HasValue)
  47. query = query.Where(x => x.TeachingMaterialPoolID == teachingMaterialID);
  48. if (teachingMaterialType.HasValue)
  49. query = query.Where(x => x.StockOutTypeID == teachingMaterialType);
  50. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  51. return query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue).
  52. OrderBy(x => x.SchoolyearName).ThenBy(x => x.TeachingMaterialCode).ToGridResultSet<StockOutView>(pageIndex, pageSize);
  53. return query.OrderBy(x => x.SchoolyearName).
  54. ThenBy(x => x.TeachingMaterialCode).ToGridResultSet<StockOutView>(pageIndex, pageSize);
  55. }
  56. public IList<StockOutView> GetStockOutStatisticsViewList(ConfiguretView configuretView, Guid? schoolyearID, Guid? supplierID, Guid? teachingMaterialID, int? teachingMaterialType,int? stockOutType)
  57. {
  58. var query = StockOutDetailDAL.GetStockOutStatisticsGridView(x => x.RecordStatus == (int)CF_GeneralPurpose.IsYes);//提取提交的统计数据
  59. if (stockOutType > 0)
  60. query = query.Where(x => x.StockOutTypeID == stockOutType);
  61. if (schoolyearID.HasValue)
  62. query = query.Where(x => x.SchoolyearID == schoolyearID);
  63. if (supplierID.HasValue)
  64. query = query.Where(x => x.SupplierID == supplierID);
  65. if (teachingMaterialID.HasValue)
  66. query = query.Where(x => x.TeachingMaterialPoolID == teachingMaterialID);
  67. if (teachingMaterialType.HasValue)
  68. query = query.Where(x => x.StockOutTypeID == teachingMaterialType);
  69. if (!string.IsNullOrEmpty(configuretView.ConditionValue))
  70. return query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue).OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToList();
  71. return query.OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToList();
  72. }
  73. }
  74. }