public ResponseDTO GetVLCCustomerCollectionsByDateAndShift(int vlcId, DateTime collectionDate, ShiftEnum shift, int?pageNumber) { ResponseDTO responseDTO = new ResponseDTO(); responseDTO.Status = true; responseDTO.Message = "Customer Collections"; responseDTO.Data = this.GetVLCCustomerCollectionByDateAndShift(vlcId, collectionDate, shift, pageNumber); return(responseDTO); }
public List <VLCCustomerCollectionDTO> GetVLCCustomerCollectionByDateAndShift(int vlcId, DateTime collectionDate, ShiftEnum shift, int?pageNumber) { List <VLCCustomerCollectionDTO> vlcCustomerMilkCollection = new List <VLCCustomerCollectionDTO>(); var vLCMilkCollection = unitOfWork.VLCMilkCollectionRepository.GetByVLCIdAndCollectionDateShift(vlcId, collectionDate, shift, pageNumber); if (vLCMilkCollection != null) { foreach (var vlcMilk in vLCMilkCollection) { vlcCustomerMilkCollection.Add(VLCMilkCollectionConvertor.ConvertToVLCCustomerCollectionDTO(vlcMilk)); } } return(vlcCustomerMilkCollection); }
public void CheckForExistingCollectionDetailByDateShiftProduct(DateTime collectionDate, ShiftEnum shift, MilkTypeEnum product, int customerId) { var existingCollection = unitOfWork.VLCMilkCollectionRepository.GetCollectionByShiftDateProduct(collectionDate, shift, product, customerId); if (existingCollection != null) { throw new PlatformModuleException("Customer Collection Already Exist with given Details"); } }
public List <VLCMilkCollection> GetByVLCIdAndCollectionDateShift(int vlcId, DateTime collectionDate, ShiftEnum shift, int?pageNumber) { DateTime collectionDat = Convert.ToDateTime(collectionDate).Date; var takePage = pageNumber ?? PagingConstant.DefaultPageNumber; var takeCount = PagingConstant.DefaultRecordCount; var vlcMilkCollection = _repository.VLCMilkCollections .Where(x => x.VLCId == vlcId && System.Data.Entity.DbFunctions.TruncateTime(x.CollectionDateTime) == collectionDat && x.ShiftId == (int)shift) .OrderByDescending(x => x.CollectionDateTime) .Skip((takePage - 1) * takeCount) .Take(takeCount) .Include("Customer") .ToList <Sql.VLCMilkCollection>(); //&& x.CollectionDate.Value.Date==collectionDate.Date && && x.CollectionShift.Equals(shift,StringComparison.CurrentCultureIgnoreCase) return(vlcMilkCollection); }
public VLCMilkCollection GetCollectionByShiftDateProduct(DateTime collectionDate, ShiftEnum shift, MilkTypeEnum productId, int customerId) { DateTime collectionDat = Convert.ToDateTime(collectionDate).Date; var vlcmilk = _repository.VLCMilkCollections.Where(v => v.ShiftId == (int)shift && System.Data.Entity.DbFunctions.TruncateTime(v.CollectionDateTime) == collectionDat && v.CustomerId == customerId).FirstOrDefault(); if (vlcmilk != null) { if (_repository.VLCMilkCollectionDtls.Where(v => v.VLCMilkCollectionId == vlcmilk.VLCMilkCollectionId && v.ProductId == (int)productId).Any()) { return(vlcmilk); } } return(null); }
public Shift(ShiftEnum shift) { _shift = shift; }