1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using EMIS.DataLogic.Common.TeachingMaterial;
- using EMIS.ViewModel.TeachingMaterial;
- using Bowin.Common.Linq.Entity;
- using EMIS.ViewModel;
- namespace EMIS.CommonLogic.TeachingMaterial
- {
- public class StockOutDetailServices : BaseServices, IStockOutDetailServices
- {
- public StockOutDetailDAL StockOutDetailDAL { get; set; }
- public IGridResultSet<StockOutView> GetStockOutDetailViewGrid(ViewModel.ConfiguretView configuretView, Guid? schoolyearID, Guid? supplierID, DateTime? stockOutTimeStart, DateTime? stockOutTimeEnd, int pageIndex, int pageSize)
- {
- var query = StockOutDetailDAL.GetStockOutDetailGridView(x => true);
- query = query.Where(x => x.RecordStatus == (int)CF_GeneralPurpose.IsYes);//提取提交的统计数据
- if (schoolyearID.HasValue)
- query = query.Where(x => x.SchoolyearID == schoolyearID);
- if (supplierID.HasValue)
- query = query.Where(x => x.SupplierID == supplierID);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- return query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue).OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToGridResultSet<StockOutView>(pageIndex, pageSize);
- return query.OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToGridResultSet<StockOutView>(pageIndex, pageSize);
- }
- public IList<StockOutView> GetStockOutDetailViewList(ViewModel.ConfiguretView configuretView, Guid? schoolyearID, Guid? supplierID, DateTime? stockOutTimeStart, DateTime? stockOutTimeEnd)
- {
- var query = StockOutDetailDAL.GetStockOutDetailGridView(x => x.RecordStatus == (int)CF_GeneralPurpose.IsYes);
-
- if (schoolyearID.HasValue)
- query = query.Where(x => x.SchoolyearID == schoolyearID);
- if (supplierID.HasValue)
- query = query.Where(x => x.SupplierID == supplierID);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- return query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue).OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToList();
- return query.OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToList();
- }
- public IGridResultSet<StockOutView> GetStockOutStatisticsViewGrid(ConfiguretView configuretView, Guid? schoolyearID, Guid? supplierID, Guid? teachingMaterialID, int? teachingMaterialType,int? stockOutType, int pageIndex, int pageSize)
- {
- var query = StockOutDetailDAL.GetStockOutStatisticsGridView(x => x.RecordStatus == (int)CF_GeneralPurpose.IsYes);//提取提交的统计数据
- if (stockOutType>0)
- query = query.Where(x => x.StockOutTypeID == stockOutType);
- if (schoolyearID.HasValue)
- query = query.Where(x => x.SchoolyearID == schoolyearID);
- if (supplierID.HasValue)
- query = query.Where(x => x.SupplierID == supplierID);
- if (teachingMaterialID.HasValue)
- query = query.Where(x => x.TeachingMaterialPoolID == teachingMaterialID);
- if (teachingMaterialType.HasValue)
- query = query.Where(x => x.StockOutTypeID == teachingMaterialType);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- return query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue).
- OrderBy(x => x.SchoolyearName).ThenBy(x => x.TeachingMaterialCode).ToGridResultSet<StockOutView>(pageIndex, pageSize);
- return query.OrderBy(x => x.SchoolyearName).
- ThenBy(x => x.TeachingMaterialCode).ToGridResultSet<StockOutView>(pageIndex, pageSize);
- }
- public IList<StockOutView> GetStockOutStatisticsViewList(ConfiguretView configuretView, Guid? schoolyearID, Guid? supplierID, Guid? teachingMaterialID, int? teachingMaterialType,int? stockOutType)
- {
- var query = StockOutDetailDAL.GetStockOutStatisticsGridView(x => x.RecordStatus == (int)CF_GeneralPurpose.IsYes);//提取提交的统计数据
- if (stockOutType > 0)
- query = query.Where(x => x.StockOutTypeID == stockOutType);
- if (schoolyearID.HasValue)
- query = query.Where(x => x.SchoolyearID == schoolyearID);
- if (supplierID.HasValue)
- query = query.Where(x => x.SupplierID == supplierID);
- if (teachingMaterialID.HasValue)
- query = query.Where(x => x.TeachingMaterialPoolID == teachingMaterialID);
- if (teachingMaterialType.HasValue)
- query = query.Where(x => x.StockOutTypeID == teachingMaterialType);
- if (!string.IsNullOrEmpty(configuretView.ConditionValue))
- return query.DynamicWhere(configuretView.Attribute, configuretView.Condition, configuretView.ConditionValue).OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToList();
- return query.OrderBy(x => x.TeachingMaterialCode.Length).ThenBy(x => x.TeachingMaterialCode).ToList();
- }
- }
- }
|