コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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");
            }
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
ファイル: Shift.cs プロジェクト: praxpetroleum/axis-capacity
 public Shift(ShiftEnum shift)
 {
     _shift = shift;
 }