public async Task CreateSize(string sizeText)
        {
            var sizes = await _sizeRepository.Get();

            var lastSize  = sizes.OrderByDescending(x => x.SizeOrder).FirstOrDefault();
            var sizeOrder = lastSize?.SizeOrder ?? 0;
            var size      = new Size {
                SizeText = sizeText, SizeOrder = sizeOrder + 1
            };
            var entity = _mapper.Map <Entities.Size>(size);
            await _sizeRepository.Create(entity);
        }
示例#2
0
        public async Task <UnitPrices> GetUnitPriceBySizeId(int SizeId)
        {
            var model = new UnitPrices();

            model.UnitPriceBySize = await unitPriceRepository.GetUnitPriceBySizeId(SizeId);

            var size = await sizeRepository.Get(SizeId);

            model.SizeName = size.SizeName;
            return(model);
        }
示例#3
0
        public async Task <List <Size> > Get()
        {
            var sizes = await sizeRepository.Get();

            return(sizes);
        }
示例#4
0
 public async Task <SizeView> Get(int SizeId)
 {
     return(await sizeRepository.Get(SizeId));
 }
示例#5
0
 public async Task <Size> Get(int id)
 {
     return(await _repository.Get(id));
 }
示例#6
0
 public Task <IEnumerable <Size> > GetSizes() => _sizeRepository.Get();