예제 #1
0
        public List <Size> GetSize(
            IUnitOfWork uow,
            SizeType sizeType          = null,
            bool onlyUseInEmployee     = false,
            bool onlyUseInNomenclature = false)
        {
            if (sizes is null)
            {
                sizes = SizeRepository.GetSize(uow);
            }
            var filterSizes = (IEnumerable <Size>)sizes;

            if (sizeType != null)
            {
                filterSizes = filterSizes.Where(x => x.SizeType == sizeType);
            }
            if (onlyUseInEmployee)
            {
                filterSizes = filterSizes.Where(x => x.UseInEmployee);
            }
            if (onlyUseInNomenclature)
            {
                filterSizes = filterSizes.Where(x => x.UseInNomenclature);
            }
            return(filterSizes.ToList());
        }
예제 #2
0
        public HttpResponseMessage PostSize([FromBody] int id)
        {
            var size = SizeRepository.GetSize(id);
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, size);

            return(response);
        }
예제 #3
0
 public void RefreshSizes(IUnitOfWork uow) =>
 sizes = SizeRepository.GetSize(uow);